code: @NullSafe
    private File validateDirectory(File directory) {
      return Optional.ofNullable(directory).filter(File::isDirectory)
        .orElseThrow(() -> newIllegalArgumentException("File [%s] is not a valid directory", directory));
    }
docs: Validates the given {@link File} is a valid directory.
  
  @param directory {@link File} to evaluate.
  @return the given {@link File}.
  @throws IllegalArgumentException if the given {@link File} is not a valid directory.
  @see java.io.File#isDirectory()