### Question:
FileUtil extends ContextAwareBase { static public boolean createMissingParentDirectories(File file) { File parent = file.getParentFile(); if (parent == null) { return true; } parent.mkdirs(); return parent.exists(); } FileUtil(Context context); static URL fileToURL(File file); static boolean createMissingParentDirectories(File file); static String prefixRelativePath(String prefix, String path); void copy(String src, String destination);  }### Answer:
@Test public void checkParentCreationInquiryAndSubsequentCreation() { File file = new File(CoreTestConstants.OUTPUT_DIR_PREFIX+"/fu"+diff+"/testing.txt"); cleanupList.add(file); cleanupList.add(file.getParentFile()); assertFalse(file.getParentFile().exists()); assertTrue(FileUtil.createMissingParentDirectories(file)); assertTrue(file.getParentFile().exists()); }
@Test public void checkDeeperParentCreationInquiryAndSubsequentCreation() { File file = new File(CoreTestConstants.OUTPUT_DIR_PREFIX+"/fu"+diff+"/bla/testing.txt"); cleanupList.add(file); cleanupList.add(file.getParentFile()); cleanupList.add(file.getParentFile().getParentFile()); assertFalse(file.getParentFile().exists()); assertTrue(FileUtil.createMissingParentDirectories(file)); assertTrue(file.getParentFile().exists()); }
@Test public void createParentDirIgnoresExistingDir() { String target = CoreTestConstants.OUTPUT_DIR_PREFIX + "/fu" + diff + "/testing.txt"; File file = new File(target); cleanupList.add(file); file.mkdirs(); assertTrue(file.getParentFile().exists()); assertTrue(FileUtil.createMissingParentDirectories(file)); }
@Test public void createParentDirAcceptsNoParentSpecified() { File file = new File("testing.txt"); assertTrue(FileUtil.createMissingParentDirectories(file)); }