@Test
public void testGetExistingDirectory_existing() throws IOException {

    final File toolHomeFile = new File(".");
    final String toolHome = toolHomeFile.getAbsolutePath();
    final File existingFile = new File(toolHome, "delete_me");
    if (!existingFile.mkdir()) {
        fail("failed to create test directory");
    }
    try {
        final File file = FileUtil.getExistingDirectory(existingFile.getAbsolutePath(), toolHome);
        assertNotNull(file);
        assertEquals(existingFile.getAbsolutePath(), file.getAbsolutePath());
    } finally {
        if (!existingFile.delete()) {
            fail("failed to delete test directory");
        }
    }
}