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