@Test
public void testDeletePathIfEmpty() throws IOException {

	final FileSystem localFs = FileSystem.getLocalFileSystem();
	
	final File dir = tmp.newFolder();
	assertTrue(dir.exists());
	final Path dirPath = new Path(dir.toURI());
	// deleting an empty directory should work
	assertTrue(FileUtils.deletePathIfEmpty(localFs, dirPath));
	// deleting a non existing directory should work
	assertTrue(FileUtils.deletePathIfEmpty(localFs, dirPath));
	// create a non-empty dir
	final File nonEmptyDir = tmp.newFolder();
	final Path nonEmptyDirPath = new Path(nonEmptyDir.toURI());
	new FileOutputStream(new File(nonEmptyDir, "filename")).close();
	assertFalse(FileUtils.deletePathIfEmpty(localFs, nonEmptyDirPath));
}