Here you can find the source of getListSum(List
public static Integer getListSum(List<Integer> list)
//package com.java2s; //License from project: Open Source License import java.util.List; public class Main { /**// www .j a v a 2 s .c o m * Return sum of all list entries * @return sum of all list entries */ public static Integer getListSum(List<Integer> list) { Integer result = null; if (list.size() > 0) { result = 0; for (Integer value : list) { result += value; } } return result; } }