public static <T> Iterator<T> unique(final Iterator<? extends T> it) {
    return filter(it, new BooleanFunction<T>() {
      private Set<T> processed;
      @Override
      public boolean fun(T t) {
        if (processed == null) {
          processed = new HashSet<>();
        }
        return processed.add(t);
      }
    });
  }
public static <T> Iterator<T> unique(final Iterator<? extends T> it)