-
Enhancement
-
Resolution: Unresolved
-
P3
-
None
Currently Stream.distinct() keeps seen values in a Set which implicitly compares them for equality. It would be nice for the application to supply some other notion of equality than the object's built-in notion. This could be phrased as passing a Predicate<T,T> that is used to determine equality between two values of type T. An alternative would be to pass a Function<T,U> that maps each value into a different value that is then stored in the set and is tested for equality.