// "Fix all 'Stream API call chain can be replaced with loop' problems in file" "true" import java.util.*; import java.util.function.Function; import java.util.stream.Stream; public class Main { public void testCast(Object obj, List list) { for (Number n : ((Iterable) obj)) { list.add(n); } } public static void main(String[] args) { List list = Arrays.asList("a", "b"); for (String s : list) { System.out.println(s); } } public static > T test(T collection) { for (Object o : collection) { System.out.println(o); } return collection; } void testRawTypeSupport(List list) { for (List l : list) { System.out.println(l.size()); } } public interface SomeInterface { Set nodes(); default void accept(Visitor visitor) { for (SomeInterface child : new LinkedHashSet<>(this.nodes())) { child.accept(visitor); } } interface Visitor { } } class X implements Iterable { class Y { void test() { for (String s : X.this) { System.out.println(s); } } } } }