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