mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-02 03:07:47 +07:00
17 lines
357 B
Java
17 lines
357 B
Java
// "Replace with collect" "true"
|
|
import java.util.*;
|
|
import java.util.stream.Collectors;
|
|
|
|
public class Collect {
|
|
class Person {
|
|
String getName() {
|
|
return "";
|
|
}
|
|
}
|
|
|
|
Set<String> names = new HashSet<>();
|
|
void collectNames(List<Person> persons){
|
|
names.addAll(persons.stream().map(Person::getName).collect(Collectors.toList()));
|
|
}
|
|
}
|