public static void cleanDirectory(File directory) throws IOException {
    requireNonNull(directory, DIRECTORY_CAN_NOT_BE_NULL);

    Path path = directory.toPath();
    if (!path.toFile().exists()) {
      return;
    }

    cleanDirectoryImpl(path);
  }
@Test
  public void cleanDirectory_throws_NPE_if_file_is_null() throws IOException {
    assertThatThrownBy(() -> FileUtils.cleanDirectory(null))
      .isInstanceOf(NullPointerException.class)
      .hasMessage("Directory can not be null");
  }