### Question:
FileUtils { public static boolean createDirectory(File dir) { if (!dir.exists() && !dir.mkdirs()) { ConsoleLogger.warning("Could not create directory '" + dir + "'"); return false; } return dir.isDirectory(); } private  FileUtils(); static boolean copyFileFromResource(File destinationFile, String resourcePath); static boolean createDirectory(File dir); static InputStream getResourceFromJar(String path); static void purgeDirectory(File directory); static void delete(File file); static void create(File file); static String makePath(String... elements); static String createCurrentTimeString(); static String createBackupFilePath(File file);  }### Answer:
@Test public void shouldCreateDirectory() throws IOException { File root = temporaryFolder.newFolder(); File dir = new File(root, "folder/folder2/myFolder"); boolean result = FileUtils.createDirectory(dir); assertThat(result, equalTo(true)); assertThat(dir.exists(), equalTo(true)); assertThat(dir.isDirectory(), equalTo(true)); }
@Test public void shouldReturnFalseOnDirectoryCreateFail() throws IOException { File root = temporaryFolder.newFolder(); File dirAsFile = new File(root, "file"); dirAsFile.createNewFile(); boolean result = FileUtils.createDirectory(dirAsFile); assertThat(result, equalTo(false)); assertThat(dirAsFile.isFile(), equalTo(true)); }