public static void deleteDirectory(File directory) throws IOException {
    requireNonNull(directory, DIRECTORY_CAN_NOT_BE_NULL);
    deleteDirectoryImpl(directory.toPath());
  }
@Test
  public void deleteDirectory_throws_IOE_if_argument_is_a_file() throws IOException {
    File file = temporaryFolder.newFile();

    assertThatThrownBy(() -> FileUtils.deleteDirectory(file))
      .isInstanceOf(IOException.class)
      .hasMessage("Directory '" + file.getAbsolutePath() + "' is a file");
  }