void (String[] arr) { boolean flag1 = false; boolean flag2 = true; for (String s : arr) { <warning descr="Loop can be terminated after condition is met">if</warning> (s == null) { flag1 = false; flag2 = false; } } }