public static void deleteDirectory(File directory) throws IOException {
        checkNotNull(directory, "directory");

        guardIfNotThreadSafe(FileUtils::deleteDirectoryInternal, directory);
    }
@Test
    void testDeleteSymbolicLinkDirectory() throws Exception {
        // creating a directory to which the test creates a symbolic link
        File linkedDirectory = TempDirUtils.newFolder(temporaryFolder);
        File fileInLinkedDirectory = new File(linkedDirectory, "child");
        assertThat(fileInLinkedDirectory.createNewFile()).isTrue();

        File symbolicLink = new File(temporaryFolder.toString(), "symLink");
        try {
            Files.createSymbolicLink(symbolicLink.toPath(), linkedDirectory.toPath());
        } catch (FileSystemException e) {
            // this operation can fail under Windows due to: "A required privilege is not held by
            // the client."
            assumeThat(OperatingSystem.isWindows())
                    .withFailMessage("This test does not work properly under Windows")
                    .isFalse();
            throw e;
        }

        FileUtils.deleteDirectory(symbolicLink);
        assertThat(fileInLinkedDirectory).exists();
    }