Update Example2.java

This commit is contained in:
Eric Martin
2019-11-02 12:30:28 -05:00
committed by GitHub
parent af3b4b8a5f
commit e5132d9886

View File

@@ -26,7 +26,7 @@ public class Example2 {
long numberOf65PlusCustomers = customers.stream() long numberOf65PlusCustomers = customers.stream()
.flatMap(c -> c.map(Stream::of) .flatMap(c -> c.map(Stream::of)
.orElseGet(Stream::empty)) .orElseGet(Stream::empty))
.mapToInt(Customer::getAge) .mapToInt(Customer::getAge)
.filter(c -> c > 65) .filter(c -> c > 65)
.count(); .count();