Returns a null-friendly comparator that considers null to be
less than non-null. When both are null, they are considered
equal. If both are non-null, the specified Comparator is used
to determine the order. If the specified comparator is null,
then the returned comparator considers all non-null values to be equal.
The returned comparator is serializable if the specified comparator is serializable.
<T> | the type of the elements to be compared | |
comparator | a Comparator for comparing non-null values |
null to be less than
non-null, and compares non-null objects with the supplied
Comparator.
Diagram: Comparator