mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-10 18:09:38 +07:00
16 lines
337 B
Java
16 lines
337 B
Java
// "Replace with collect" "true"
|
|
import java.util.*;
|
|
import java.util.stream.Collectors;
|
|
|
|
public class Collect {
|
|
class Person {
|
|
String getName() {
|
|
return "";
|
|
}
|
|
}
|
|
|
|
void collectNames(List<Person> persons, Set<String> names){
|
|
names.addAll(persons.stream().map(Person::getName).collect(Collectors.toList()));
|
|
}
|
|
}
|