blob: 641617eb642b817291c6c03b155617eea658a5fc [file] [log] [blame]
// "Replace with collect" "true"
import java.util.*;
import java.util.stream.Collectors;
public class Collect {
class Person {
String getName() {
return "";
}
}
ArrayList<String> foo() {
return new ArrayList<>();
}
void collectNames(List<Person> persons){
List<String> names = foo();
names.addAll(persons.stream().map(Person::getName).collect(Collectors.toList()));
}
}