code: public static <Accumulator, Value> Accumulator reduce(List<Value> list, Accumulator init, ReduceClosure<Accumulator,Value> f) {
          Accumulator accumulator = init;
          for (Value value : list) {
              accumulator = f.eval(accumulator, value);
          }
          return accumulator;
      }
docs: Applies a binary function between each element of the given list.
  @param list      list of elements
  @param init      initial value for the accumulator
  @param f         accumulator expression to apply
  @param <Accumulator>     binary function
  @param <Value>           element type
  @return an accumulated/aggregated value