To group and calculate the sum, I use the construction
public class Test { public static void main(String[] args) { List list = n