public static void main(String[] args) {
ArrayList<Student> list = new ArrayList<>();
list.add(new Student(1,new BigDecimal(10)));
list.add(new Student(1,new BigDecimal(10)));
list.add(new Student(2,new BigDecimal(10)));
list.add(new Student(2,new BigDecimal(10)));
Map<Integer, Double> collect = list.stream().
collect(Collectors.groupingBy(Student::getId, Collectors.summingDouble(o -> o.getCount().doubleValue())));
collect.toString();
}