### Question:
KubernetesUtils { public static void deleteDirectory(Path path) throws KubernetesPluginException { Path pathToBeDeleted = path.toAbsolutePath(); if (!Files.exists(pathToBeDeleted)) { return; } try { Files.walk(pathToBeDeleted) .sorted(Comparator.reverseOrder()) .map(Path::toFile) .forEach(File::delete); } catch (IOException e) { throw new KubernetesPluginException("unable to delete directory: " + path, e); } }  static void writeToFile(String context, String outputFileName); static void writeToFile(Path outputDir, String context, String fileSuffix); static byte[] readFileContent(Path targetFilePath); static void copyFileOrDirectory(String source, String destination); static void printInfo(String msg); static void printError(String msg); static void printDebug(String msg); static void printWarning(String message); static void printInstruction(String msg); static void deleteDirectory(Path path); static boolean isBlank(String str); static String resolveValue(String value); static List<String> getList(BLangExpression expr); static Map<String, String> getMap(BLangExpression expr); static boolean getBooleanValue(BLangExpression expr); static long getLongValue(BLangExpression expr); static int getIntValue(BLangExpression expr); static String getStringValue(BLangExpression expr); static String getValidName(String name); static DeploymentBuildExtension parseBuildExtension(BLangExpression buildExtensionValue); static Map<String, EnvVarValueModel> getEnvVarMap(BLangExpression envVarValues); static Set<String> getImagePullSecrets(BLangRecordLiteral.BLangRecordKeyValueField keyValue); static Set<CopyFileModel> getExternalFileMap(BLangRecordLiteral.BLangRecordKeyValueField keyValue); static List<EnvVar> populateEnvVar(Map<String, EnvVarValueModel> envMap); static List<BLangRecordLiteral.BLangRecordKeyValueField> convertRecordFields(
            List<BLangRecordLiteral.RecordField> fields); static AnnotationAttachmentNode createAnnotation(String annotationName);  }### Answer:
@Test public void deleteDirectoryTest() throws IOException, KubernetesPluginException { File file = tempDirectory.resolve("myfile.txt").toFile(); Assert.assertTrue(file.createNewFile()); File directory = tempDirectory.resolve("subFolder").toFile(); Assert.assertTrue(directory.mkdirs()); KubernetesUtils.deleteDirectory(file.toPath()); KubernetesUtils.deleteDirectory(directory.toPath()); }