When using Collection.sort in Java what should I return when one of the inner objects is null
Example:
Collections.sort(list, new Comparator
if comparing two property, attr1 natural order, attr2 reverse order, and attr2 can be null:
datas.sort(comparing(Data::getAttr1, naturalOrder()). thenComparing(Data::getAttr2, nullsLast(reverseOrder())));