code: private static File validateFile(File file) throws IllegalArgumentException {
      if (!file.isFile()) {
        throw new IllegalArgumentException("Path is not a file: " + file);
      }
      if (!file.canRead()) {
        throw new IllegalArgumentException("Unable to read file: " + file);
      }
      return file;
    }
docs: Validates {@code file} is an existing file that is readable.
  
  @param file the File to test
  @return the provided file, if all validation passes
  @throws IllegalArgumentException if validation fails