public static Object sum(Iterable self, Object initialValue, Closure closure) {
        return sum(self, initialValue, closure, false);
    }
public static Object sum ( Iterable self , Object initialValue , Closure closure ) { return sum ( self , initialValue , closure , false ) ; }
Sums the result of applying a closure to each item of an Iterable to some initial value.
<code>coll.sum(initVal, closure)</code> is equivalent to:
<code>coll.collect(closure).sum(initVal)</code>.
<pre class="groovyTestCase">assert 50+4+6+10+12 == [2,3,5,6].sum(50) { it * 2 }</pre>

@param self         an Iterable
@param closure      a single parameter closure that returns a numeric value.
@param initialValue the closure results will be summed to this initial value
@return The sum of the values returned by applying the closure to each
item of the collection.
@since 1.5.0