Hi,
When using Collection.sort in Java what should I return when one of the inner objects is null
Example:
Collections.sort(list, new Comparator<MyBean>() {
public int compare(MyBean o1, MyBean o2) {
return o2.getDate().compareTo(o1.getDate());
}
});
Lets say o2 is not null but o2.getDate() it is, so should I return 1 or -1 or 0 when adding a null validation?