@Test
public void testPreventDuplicateFileName() {

    String baseDir = TestUtils.getPath("utils").toString();
            
    try {
        File dir = new File(baseDir);
        assertTrue(dir.isDirectory());
        File[] files = dir.listFiles();
        if(files.length == 0) {
            new File(baseDir + "/emptyfile.xml").createNewFile();
            new File(baseDir + "/emptyfile").createNewFile();
            files = dir.listFiles();
        }
        String newFileName1 =
                Utils.createFileWithUniqueName(baseDir + "/emptyfile.xml").toString();
        String newFileName2 =
                Utils.createFileWithUniqueName(baseDir + "/emptyfile").toString();
        assertNotEquals(newFileName1, newFileName2);
        for (File file : files) {
            assertNotEquals(file.getAbsolutePath(), newFileName1);
            assertNotEquals(file.getAbsolutePath(), newFileName2);
        }
        new File(newFileName1).delete();
        new File(newFileName2).delete();   
    } catch (IOException e) {
    	e.printStackTrace();
        fail();
    }
}