title: Is there a type-safe Java implementation of 'reduce'?
body: <p>I often need to run reduce (also called foldl / foldr, depending on your contexts) in java to aggregate elements of an Itterable.  </p>
  
  <p>Reduce takes a collection/iterable/etc, a function of two parameters, and an optional start value (depending on the implementation details).  The function is successively applied to an element of the collection and the output of the previous invocation of reduce until all elements have been processed, and returns the final value.</p>
  
  <p>Is there a type-safe implementation of reduce in any common java api? <a href="http://google-collections.googlecode.com" rel="noreferrer">Google Collections</a> <em>seems</em> like it should have one, but I haven't been able to find it. (possibly because I don't know what other names it would use.)</p>