// "Replace with collect" "false" import java.io.IOException; import java.util.ArrayList; import java.util.List; public class ForEachTest { interface A { String ii() throws IOException; } private List reqs; public ForEachTest () throws IOException { List result = new ArrayList<>(); for(A val : reqs) { result.add(val.ii()); } } }