### Question:
Directory extends Path { public void deleteContents() { visitChildren( new FileVisitor() { @Override public boolean visit(File file) { file.delete(); return true; } }, new DirectoryVisitor() { public boolean visit(Directory directory) { directory.deleteContents(); directory.delete(); return true; } }); }  abstract File getFile(String name); abstract Directory getDirectory(String name); Directory createDirectory(String name); abstract boolean exists(); abstract void create(); abstract void renameTo(String newName); abstract void visitChildren(@Nullable FileVisitor fileVisitor, @Nullable DirectoryVisitor directoryVisitor,
                                       @Nullable VisitFailed visitFailed); void visitChildren(@Nullable FileVisitor fileVisitor, @Nullable DirectoryVisitor directoryVisitor); abstract void delete(); abstract long getLastModifiedTime(); abstract void setLastModifiedTime(long time); abstract boolean isSetLastModifiedTimeSupported(); void deleteContents(); boolean isEmpty();  }### Answer:
@Test public void testDeleteContents() { Directory testOutputDirectory = Paths.getInstance().getTestOutputDirectory("testDeleteContents"); Directory directory = testOutputDirectory.createDirectory("dir"); Directory childDirectory = testOutputDirectory.createDirectory("child-dir"); testOutputDirectory.deleteContents(); assertTrue(testOutputDirectory.isEmpty()); }