### Question:
TransformedGenerator extends LoopGenerator<E> { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof TransformedGenerator<?, ?>)) { return false; } TransformedGenerator<?, ?> other = (TransformedGenerator<?, ?>) obj; return other.getWrappedGenerator().equals(getWrappedGenerator()) && other.func == func; } @SuppressWarnings("unchecked")  TransformedGenerator(Generator<? extends I> wrapped, Function<? super I, ? extends E> func); @SuppressWarnings("unchecked") void run(final Procedure<? super E> proc); @Override boolean equals(Object obj); @Override int hashCode();  }### Answer:
@Test public void testEquals() { TransformedGenerator<Integer, Integer> anotherTransformedGenerator = new TransformedGenerator<Integer, Integer>(wrappedGenerator, sumsTwo); assertEquals(sumsTwoGenerator, sumsTwoGenerator); assertEquals(sumsTwoGenerator, anotherTransformedGenerator); assertTrue(!sumsTwoGenerator.equals((TransformedGenerator<Integer, Integer>)null)); TransformedGenerator<Integer, Integer> aGenerateWithADifferentFunction = new TransformedGenerator<Integer, Integer>(wrappedGenerator, new Function<Integer, Integer>() { public Integer evaluate( Integer obj ) { return obj; } }); assertTrue( !sumsTwoGenerator.equals(aGenerateWithADifferentFunction)); TransformedGenerator<Integer, Integer> aTransformedGeneratorWithADifferentWrapped = new TransformedGenerator<Integer, Integer>( IteratorToGeneratorAdapter.adapt(new IntegerRange(1,2)), sumsTwo); assertTrue(!sumsTwoGenerator.equals(aTransformedGeneratorWithADifferentWrapped)); }