Here you can find the source of sum_ints(List
public static int sum_ints(List<Integer> list)
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { public static int sum_ints(List<Integer> list) { if (list == null || list.size() < 1) return 0; // shouldn't this throw a null pointer exception? otherwise how do we differentiate null from a list of zeroes? int sum = 0; for (Integer i : list) sum = sum + i;//from w w w. j av a 2s . co m return sum; } }