on<T> static method
Returns a Comparator that compares objects of type T by mapping then to Comparables.
Implementation
static Comparator<T> on<T>(Comparable Function(T t) mapper) {
return (a, b) => mapper(a).compareTo(mapper(b));
}