Update Example2.java
This commit is contained in:
parent
0e23f2e682
commit
8e973888ad
|
@ -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();
|
||||||
|
|
Loading…
Reference in New Issue