### Question:
FoldLeft implements Function<Generator<T>, T>, BinaryFunction<Generator<T>, T, T> { public FoldLeft(BinaryFunction<? super T, ? super T, ? extends T> func) { this.function = func; } FoldLeft(BinaryFunction<? super T, ? super T, ? extends T> func); final T evaluate(Generator<T> obj); final T evaluate(Generator<T> left, T right); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void testFoldLeft() { FoldLeft<Integer> foldLeft = new FoldLeft<Integer>(new BinaryFunction<Integer, Integer, Integer>() { public Integer evaluate(Integer a, Integer b) { return Integer.valueOf(a + b); } }); assertEquals(Integer.valueOf(sum), foldLeft.evaluate(IteratorToGeneratorAdapter.adapt(list.iterator()))); assertEquals(Integer.valueOf(sum), foldLeft.evaluate(IteratorToGeneratorAdapter.adapt(list.iterator()), Integer.valueOf(0))); assertEquals(Integer.valueOf(0), foldLeft.evaluate(IteratorToGeneratorAdapter.adapt(new ArrayList<Integer>(0).iterator()), Integer.valueOf(0)), Integer.valueOf(0)); }