// "Replace with forEach" "true" import java.util.ArrayList; import java.util.List; class Sample { List foo = new ArrayList<>(); String foo(){ for (String s : (List)foo) { if (s == null) { System.out.println(s); } } return null; } }