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