Arraylist<Integer> list = new ArrayList<Integer>(); int sum = list.stream().mapToInt(Integer::intValue).sum();