### Question:
DockerPluginUtils { public static void deleteDirectory(Path pathToBeDeleted) throws DockerPluginException { if (!Files.exists(pathToBeDeleted)) { return; } try { Files.walk(pathToBeDeleted) .sorted(Comparator.reverseOrder()) .map(Path::toFile) .forEach(File::delete); } catch (IOException e) { throw new DockerPluginException("Unable to delete directory: " + pathToBeDeleted.toString(), e); } }  static void printError(String msg); static List<BLangRecordLiteral.BLangRecordKeyValueField> getKeyValuePairs(BLangRecordLiteral bLangRecordLiteral); static void printDebug(String msg); static boolean isBlank(String str); static void deleteDirectory(Path pathToBeDeleted); static String resolveValue(String value); static AnnotationAttachmentNode createAnnotation(String annotationName);  }### Answer:
@Test public void deleteDirectoryTest() throws IOException, DockerPluginException { File file = tempDirectory.resolve("myfile.txt").toFile(); Assert.assertTrue(file.createNewFile()); File directory = tempDirectory.resolve("subFolder").toFile(); Assert.assertTrue(directory.mkdirs()); DockerPluginUtils.deleteDirectory(file.toPath()); Assert.assertFalse(file.exists(), "myfile.txt not deleted"); DockerPluginUtils.deleteDirectory(directory.toPath()); Assert.assertFalse(directory.exists(), "subFolder not deleted"); }