Here you can find the source of sumBig(final Collection extends BigDecimal> values)
public static BigDecimal sumBig(final Collection<? extends BigDecimal> values)
//package com.java2s; /******************************************************************************* * Copyright (c) 2015, 2017 Lablicate GmbH. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors:/*w w w . j a v a 2s. c o m*/ * Dr. Alexander Kerner - initial API and implementation *******************************************************************************/ import java.math.BigDecimal; import java.util.Collection; public class Main { public static BigDecimal sumBig(final Collection<? extends BigDecimal> values) { final BigDecimal result = BigDecimal.ZERO; for (final BigDecimal n : values) { result.add(n); } return result; } /** * Add one {@link Integer} to another. * * @param integer1 * first {@link Integer} * @param integer2 * second {@link Integer} * @return sum of {@code integer1} and {@code integer2} */ public static Integer add(final Integer integer1, final Integer integer2) { return Integer.valueOf(integer1.intValue() + integer2.intValue()); } }