LogiCoy interview question

java 8 question