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