java 8 lambdas, chapter 4, exercise 3