public static <T extends Comparable<T>> T max(T lhs, T rhs) {
        return BinaryOperator.maxBy(new ComparableComparator<T>()).apply(lhs, rhs);
    }
public static < T extends Comparable < T > > T max ( T lhs , T rhs ) { return BinaryOperator . maxBy ( new ComparableComparator < T > ( ) ) . apply ( lhs , rhs ) ; }
Evaluates max of two comparable elements.

@param <T> the element type
@param lhs the left element
@param rhs the right element
@return the greater element