code: public static <T, U> Collector<T, ?, Optional<U>> max(Function<? super T, ? extends U> function, Comparator<? super U> comparator) {
          return collectingAndThen(maxBy(function, comparator), t -> t.map(function));
      }
docs: Get a {@link Collector} that calculates the <code>MAX()</code> function.