public static <T> Comparator<T> invert(Comparator<T> comparator) {
    return (obj1, obj2) -> (-1 * comparator.compare(obj1, obj2));
  }
public static < T > Comparator < T > invert ( Comparator < T > comparator ) { return ( obj1 , obj2 ) -> ( - 1 * comparator . compare ( obj1 , obj2 ) ) ; }
Inverts the result of the {@link Comparator}.  Used to implement a descending sort order.

@param <T> {@link Class} type of {@link Comparable} objects in the comparison.
@param comparator the {@link Comparator} to invert.
@return a {@link Comparator} wrapper around the given {@link Comparator} inverting the result
of the comparison.
@see java.util.Comparator