// "Fix all 'Stream API call chain can be replaced with loop' problems in file" "true" import java.util.*; public class Main { private static void test(List list) { for (String x : list) { if (x != null) { System.out.println(x); } } } public static void main(String[] args) { test(Arrays.asList("a", "b", "xyz")); } void testLocal() { class X extends ArrayList { class Y { void test() { for (String s : X.this) { System.out.println(s); } } } } } void testAnonymous() { new ArrayList() { class Y { void test() { for (Iterator it = stream().iterator(); it.hasNext(); ) { String s = it.next(); System.out.println(s); } } } }; } }