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) {
Another way to effectively guard against a null in a for loop is to wrap your collection with Google Guava's OptionalOptional.isPresent().