public static void deleteDirectoryQuietly(File directory) {
        if (directory == null) {
            return;
        }

        // delete and do not report if it fails
        try {
            deleteDirectory(directory);
        } catch (Exception ignored) {
        }
    }
@Test
    void testDeleteQuietly() throws Exception {
        // should ignore the call
        FileUtils.deleteDirectoryQuietly(null);
        File doesNotExist = TempDirUtils.newFolder(temporaryFolder, "abc");
        FileUtils.deleteDirectoryQuietly(doesNotExist);

        File cannotDeleteParent = TempDirUtils.newFolder(temporaryFolder);
        File cannotDeleteChild = new File(cannotDeleteParent, "child");

        try {
            assertThat(cannotDeleteChild.createNewFile()).isTrue();
            assertThat(cannotDeleteParent.setWritable(false)).isTrue();
            assertThat(cannotDeleteChild.setWritable(false)).isTrue();

            FileUtils.deleteDirectoryQuietly(cannotDeleteParent);
        } finally {
            //noinspection ResultOfMethodCallIgnored
            cannotDeleteParent.setWritable(true);
            //noinspection ResultOfMethodCallIgnored
            cannotDeleteChild.setWritable(true);
        }
    }