public String abbreviate(final String name) {
        if(StringUtils.startsWith(name, preferences.getProperty("local.user.home"))) {
            return Local.HOME + StringUtils.removeStart(name, preferences.getProperty("local.user.home"));
        }
        return name;
    }
@Test
    public void testAbbreviate() {
        assertEquals("~/f", new TildeExpander().abbreviate(System.getProperty("user.home") + "/f"));
    }