Pregunta de entrevista de UBS

how do you apply group by Claus using Java