### Question:
PathUtils { public static void deletePath(String path) { File file = new File(path); if (file.isDirectory()) { String[] files = file.list(); for (String f : files) { deletePath(file.getAbsolutePath() + "/" + f); } } file.delete(); }  static void deletePath(String path);  }### Answer:
@Test public void testDeletePath() { File file = new File("testdata"); file.mkdir(); assertTrue(file.exists()); file = new File("testdata/data1"); file.mkdir(); assertTrue(file.exists()); file = new File("testdata/data2"); file.mkdir(); assertTrue(file.exists()); PathUtils.deletePath("testdata"); assertFalse(new File("testdata").exists()); }