code: private static final HadoopPath toHadoopPath(Path path) {
      if (path == null) {
        throw new NullPointerException();
      }
      if (!(path instanceof HadoopPath)) {
        throw new ProviderMismatchException();
      }
      return (HadoopPath) path;
    }
docs: Checks that the given file is a HadoopPath