code: public static <R extends Resource, X> ResourcePredicate<R> distinctFilter(FunctionWithThrowable<R, X, IOException> function) {
          final Map<X, Boolean> seen = Maps.newConcurrentMap();
          return resource -> seen.putIfAbsent(function.apply(resource), Boolean.TRUE) == null;
      }
docs: A predicate to filter out already seen resources by function.
  
  @param function The function to determine the resource value.
  @param <R>      The Resource implementation.
  @param <X>      The Value type.
  @return A stateful predicate.