### Question:
FileUtils { public static boolean deleteRecursiveDir(final File directory) { if (directory == null) { return true; } boolean retour = true; if (!directory.exists()) { return true; } if (!directory.isDirectory()) { return false; } final File[] list = directory.listFiles(); if (list == null || list.length == 0) { retour = directory.delete(); return retour; } for (final File file : list) { if (file.isDirectory()) { if (!deleteRecursiveFileDir(file)) { retour = false; } } else { retour = false; } } if (retour) { retour = directory.delete(); } return retour; } private  FileUtils(); static void close(final Reader stream); static void close(final Writer stream); static void close(final InputStream stream); static void close(final OutputStream stream); static void close(final RandomAccessFile accessFile); static boolean deleteDir(final File directory); static boolean delete(final File file); static File[] copyRecursive(final File from, final File directoryTo,
                                     final boolean move); static File[] copy(final File[] from, final File directoryTo,
                            final boolean move); static boolean createDir(final File directory); static void copy(final File from, final File to, final boolean move,
                          final boolean append); static boolean forceDeleteRecursiveDir(final File directory); static boolean deleteRecursiveDir(final File directory); static boolean fileExist(final String fileName, final String path); static File[] getFiles(final File directory); static void computeGlobalHash(final FilesystemBasedDigest digest,
                                       final File file, final int length); static File[] getFiles(final File directory,
                                final FilenameFilter filter); static long uncompressedBz2File(final File fileIn,
                                         final File fileOut); static long copy(final InputStream from, final OutputStream to); static final int ZERO_COPY_CHUNK_SIZE; }### Answer:
@Test public void deleteRecursiveDir() throws IOException { generateFiles(); assertTrue(FileUtils.fileExist(file1.getName(), file1.getParent())); assertFalse(FileUtils.deleteRecursiveDir(dirSource)); assertTrue(FileUtils.forceDeleteRecursiveDir(dirSource)); generateFiles(); file1.delete(); file2.delete(); assertTrue(FileUtils.deleteRecursiveDir(dirSource)); }