Since all of them are immutable, why would one want it?
Sometimes it's a better alternative to returning null
.
public List<?> getList(){
if(list == null){
return Collections.emptyList();
}
return list;
}
Reference
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With