Some simple functional programming in java 8