Slide 38
Slide 38 text
Making (more) sense
of Collections
range(1,6).stream()
.count()
// => 5
.reduce(0, (acc, n) -> acc * n )
// => 120
.map( n -> n * n ).collect(toList())
// => [1,4,9,16,25]
.filter( n -> n % 2 == 0 ).collect(toList())
// => [2,4]