Assignment for learning functional programming in Java 8