Pregunta de entrevista de Cognizant

Sort array based on stream java8