// "Replace iteration with bulk 'Collection.addAll()' call" "true-preview" import java.util.ArrayList; import java.util.List; class Sample { List foo = new ArrayList<>(); String foo(){ Sample sm = new Sample(); for (String s : foo) { sm.foo.add(s); } return null; } }