code: public static <T, Y extends Comparable<Y>> Collector<T, ?, Optional<T>> maxBy(Function<T, Y> projection) {
          return maxBy(projection, Comparable::compareTo);
      }
docs: Find the item for which the supplied projection returns the maximum value.
  @param projection The projection to apply to each item.
  @param <T> The type of each item.
  @param <Y> The type of the projected value to compare on.
  @return The collector.