Here you can find the source of sum(final long... values)
public static long sum(final long... values)
//package com.java2s; /**//from www . j a v a 2s .c o m * Copyright? 2014-2016 LIST (Luxembourg Institute of Science and Technology), all right reserved. * Authorship : Olivier PARISOT, Yoanne DIDRY * Licensed under GNU General Public License version 3 */ public class Main { public static double sum(final double... values) { double result = 0d; for (final double value : values) result += value; return result; } public static long sum(final long... values) { long result = 0; for (final long value : values) result += value; return result; } }