public static BigDecimal sum(final Object[] target) {
        Validate.notNull(target, "Cannot aggregate on null");
        Validate.containsNoNulls(target, "Cannot aggregate on array containing nulls");
        if (target.length == 0) {
            return null;
        }
        BigDecimal total = BigDecimal.ZERO;
        for (final Object element : target) {
            total = total.add(toBigDecimal((Number)element));
        }
        return total;
    }
public static BigDecimal sum ( final Object [ ] target ) { Validate . notNull ( target , "Cannot aggregate on null" ) ; Validate . containsNoNulls ( target , "Cannot aggregate on array containing nulls" ) ; if ( target . length == 0 ) { return null ; } BigDecimal total = BigDecimal . ZERO ; for ( final Object element : target ) { total = total . add ( toBigDecimal ( ( Number ) element ) ) ; } return total ; }
<p>
Returns the sum of all the numbers contained in the provided array.
</p>

@param target the array of numbers
@return the sum, as a BigDecimal