import java.util.List; import java.util.Map; import java.util.Optional; import java.util.function.BinaryOperator; import java.util.function.Function; import java.util.stream.Collector; class Stuff { public enum Type { A } private final int value; private final Type type; public Stuff(int value, Type type) { this.value = value; this.type = type; } public int getValue() { return value; } public Type getType() { return type; } } class FakeErrors { { Collector>> collector = groupingBy(Stuff::getType, reducing((d1, d2) -> { boolean b = d1.getValue() > d2.getValue(); return d1; })); } public static Collector> reducing(BinaryOperator op) { return null; } public static Collector> groupingBy(Function classifier, Collector downstream) { return null; } }