### Question:
IteratorToGeneratorAdapter extends LoopGenerator<E> { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof IteratorToGeneratorAdapter<?>)) { return false; } IteratorToGeneratorAdapter<?> that = (IteratorToGeneratorAdapter<?>) obj; return this.iter.equals(that.iter); } IteratorToGeneratorAdapter(Iterator<? extends E> iter); void run(Procedure<? super E> proc); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString(); static IteratorToGeneratorAdapter<E> adapt(Iterator<? extends E> iter); static IteratorToGeneratorAdapter<E> adapt(Iterable<? extends E> iterable);  }### Answer:
@Test public void testEquals() { Iterator<String> iter = list.iterator(); Generator<String> gen = new IteratorToGeneratorAdapter<String>(iter); assertObjectsAreEqual(gen,gen); assertObjectsAreEqual(gen,new IteratorToGeneratorAdapter<String>(iter)); }