Infosys interview question

Example for java streams and its functions