### Question:
UntilGenerate extends LoopGenerator<E> { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof UntilGenerate<?>)) { return false; } UntilGenerate<?> other = (UntilGenerate<?>) obj; return other.getWrappedGenerator().equals(getWrappedGenerator()) && other.test.equals(test); } UntilGenerate(Predicate<? super E> test, Generator<? extends E> wrapped); void run(final Procedure<? super E> proc); @Override boolean equals(Object obj); @Override int hashCode();  }### Answer:
@Test public void testEquals() { Generator<Integer> anotherGenerate = new UntilGenerate<Integer>( isGreaterThanFive, IteratorToGeneratorAdapter.adapt(new IntegerRange(1, 10))); assertEquals(untilGenerate, untilGenerate); assertEquals(untilGenerate, anotherGenerate); assertTrue(!untilGenerate.equals((UntilGenerate<Integer>)null)); Generator<Integer> aGenerateWithADifferentPredicate = new UntilGenerate<Integer>( new Predicate<Integer>() { public boolean test(Integer obj) { return obj < FIVE; } }, IteratorToGeneratorAdapter.adapt(new IntegerRange(1, 10))); assertTrue(!untilGenerate.equals(aGenerateWithADifferentPredicate)); Generator<Integer> aGenerateWithADifferentWrapped = new UntilGenerate<Integer>( isGreaterThanFive, IteratorToGeneratorAdapter.adapt(new IntegerRange(1,2))); assertTrue(!untilGenerate.equals(aGenerateWithADifferentWrapped)); }