Accenture Interview Question

groupingby using java 8 streams