java 8 lambdas, chapter 3, exercise 1