java 8 lambdas, chapter 3, exercise 2