Adding initial solution in Java 8