mapping<T, V> static method
Use if you already have a custom comparator you wish to use but your list needs some mapping to get to the comparator's type. I.e., creates a Comparator
Implementation
static Comparator<V> mapping<T, V>(
Comparator<T> comparator,
T Function(V v) mapper,
) {
return (a, b) => comparator(mapper(a), mapper(b));
}