mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-17 15:50:53 +07:00
15 lines
364 B
Java
15 lines
364 B
Java
// "Replace iteration with bulk 'Collection.addAll()' call" "true-preview"
|
|
import java.util.*;
|
|
|
|
public class Collect {
|
|
static class Person {}
|
|
|
|
void collectNames(List<Person> persons, Collection<Person> toAdd){
|
|
Iterator<Person> it = toAdd.iterator();
|
|
while (it.hasNext()) {
|
|
Person person = it.next();
|
|
persons<caret>.add(person);
|
|
}
|
|
}
|
|
}
|