@Test
public void getFileWithIncrementedNameShouldUseTheSameParent() throws IOException {

    final String home = System.getProperty("user.home");
    final String homeWithSeparator = home + File.separatorChar;
    createTemporaryFile(homeWithSeparator + "donkeys.jpg");
    createTemporaryFile(homeWithSeparator + "donkeys_1.jpg");
    final File file = Tools.getFileWithIncrementedName(new File(homeWithSeparator + "donkeys.jpg"));
    assertEquals("donkeys_2.jpg", file.getName());
    assertEquals(home, file.getParent());
}