Here you can find the source of add(final String start, final String... values)
public static BigDecimal add(final String start, final String... values)
//package com.java2s; //License from project: Apache License import java.math.BigDecimal; public class Main { /**//from ww w. j av a2 s.co m * Add n BigDecimal safely (i.e. handles nulls) */ public static BigDecimal add(final BigDecimal start, final BigDecimal... values) { BigDecimal total = start != null ? start : BigDecimal.ZERO; if (values != null) { for (final BigDecimal v : values) { total = doAdd(total, v); } } return total; } public static BigDecimal add(final String start, final String... values) { BigDecimal total = start != null ? new BigDecimal(start) : BigDecimal.ZERO; if (values != null) { for (final String v : values) { total = doAdd(total, new BigDecimal(v)); } } return total; } /** * Add 2 BigDecimal safely (i.e. handles nulls) */ private static BigDecimal doAdd(final BigDecimal v1, final BigDecimal v2) { BigDecimal total = v1; if (v1 != null && v2 != null) { total = v1.add(v2); } else if (v2 != null) { total = v2; } return total; } }