Accepts a function that extracts an
int sort key from a type
T, and returns a
Comparator<T> that compares by that
The returned comparator is serializable if the specified function is also serializable.
|the type of element to be compared|
|the function used to extract the integer sort key|
|if the argument is null|