Here you can find the source of sum(final int base, final int[] ints)
public static int sum(final int base, final int[] ints)
//package com.java2s; // it under the terms of the GNU General Public License as published by import java.util.ArrayList; import java.util.Collection; public class Main { public static int sum(int a, int b) { return sum(new int[] { a, b }); }/*from www. j a va 2 s. co m*/ public static int sum(final Collection<Integer> ints) { return sum(0, ints); } public static int sum(final int[] ints) { return sum(0, ints); } public static int sum(final int base, final Collection<Integer> ints) { int ret = base; for (Integer i : ints) ret += i; return ret; } public static int sum(final int base, final int[] ints) { return sum(base, toIntegerCollection(ints)); } public static Collection<Integer> toIntegerCollection(int[] ints) { ArrayList<Integer> ret = new ArrayList<Integer>(); for (int i : ints) ret.add(new Integer(i)); return ret; } }