What is the best way to guard against null in a for loop in Java?
This seems ugly :
if (someList != null) { for (Object object : someList) {
for (Object object : someList) { // do whatever } throws the null pointer exception.