@Test
public void expandUserHome_withHomeShortcut() {

    String homeDir = System.getProperty("user.home");
    String expandedPath = FileUtils.expandUserHome("~/foobar");
    // switch here to make sure test works regardless of platform
    if (SystemUtils.IS_OS_WINDOWS) {
        assertEquals(homeDir + "\\foobar", expandedPath);
    } else {
        assertEquals(homeDir + "/foobar", expandedPath);
    }
}