mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-02 03:07:47 +07:00
14 lines
307 B
Java
14 lines
307 B
Java
// "Replace with sum()" "true"
|
|
|
|
import java.util.List;
|
|
|
|
public class Main {
|
|
interface Person {
|
|
double getAge();
|
|
}
|
|
|
|
public double test(List<Person> collection) {
|
|
double d = collection.stream().filter(person -> !(person.getAge() == 10)).mapToDouble(Person::getAge).sum();
|
|
return d;
|
|
}
|
|
} |