java 8 lambdas, chapter 5, exercise 2