mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-02 03:07:47 +07:00
15 lines
296 B
Java
15 lines
296 B
Java
// "Replace with forEach" "true"
|
|
import java.util.*;
|
|
|
|
public abstract class Collect implements Collection<String>{
|
|
class Person {
|
|
String getName() {
|
|
return "";
|
|
}
|
|
}
|
|
|
|
void collectNames(List<Person> persons){
|
|
persons.stream().map(Person::getName).forEach(this::add);
|
|
}
|
|
}
|