I\'m implementing compareTo() method for a simple class such as this (to be able to use Collections.sort() and other goodies offered by the Java pl
If you want a simple Hack:
arrlist.sort((o1, o2) -> {
if (o1.getName() == null) o1.setName("");
if (o2.getName() == null) o2.setName("");
return o1.getName().compareTo(o2.getName());
})
if you want put nulls to end of the list just change this in above metod
return o2.getName().compareTo(o1.getName());