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