### Question:
RandomGenerator extends AbstractGenerator<T> { @Override public boolean equals(Object other) { return EqualsBuilder.reflectionEquals(this, other, excludedFields); } RandomGenerator(Iterable<? extends T> iterable);  RandomGenerator(Iterable<? extends T> iterable, Random random); @Override T next(); @Override boolean equals(Object other); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void shouldBeEqualIfSuppliedIterablesAreTheSame() throws Exception { RandomGenerator<Integer> firstGenerator = new RandomGenerator<Integer>(iterableWith(1, 2, 3, 4, 5, 6)); RandomGenerator<Integer> secondGenerator = new RandomGenerator<Integer>(iterableWith(1, 2, 3, 4, 5, 6)); boolean equal = firstGenerator.equals(secondGenerator); assertThat(equal, is(true)); }
@Test public void shouldNotBeEqualIfSuppliedIterablesAreDifferent() throws Exception { RandomGenerator<Integer> firstGenerator = new RandomGenerator<Integer>(iterableWith(1, 2, 3, 4, 5, 6)); RandomGenerator<Integer> secondGenerator = new RandomGenerator<Integer>(iterableWith(7, 8, 9, 10, 11, 12)); boolean equal = firstGenerator.equals(secondGenerator); assertThat(equal, is(false)); }