@Test public void shouldAlwaysReturnTheSuppliedValueForNext() throws Exception { final String expectedValue = "Hello"; final ConstantGenerator<String> generator = new ConstantGenerator<String>(expectedValue); Iterable<String> values = take(toGeneratable(generator), 1000); assertThat(values, hasAllElementsSatisfying(new SelfDescribingPredicate<String>() { @Override public boolean evaluate(String actualValue) { return actualValue.equals(expectedValue); } @Override public String describe() { return "value equal to: " + expectedValue; } })); }
@Override public boolean equals(Object other) { return EqualsBuilder.reflectionEquals(this, other); }
ConstantGenerator extends AbstractGenerator<T> { @Override public boolean equals(Object other) { return EqualsBuilder.reflectionEquals(this, other); } }
ConstantGenerator extends AbstractGenerator<T> { @Override public boolean equals(Object other) { return EqualsBuilder.reflectionEquals(this, other); } ConstantGenerator(T value); }
ConstantGenerator extends AbstractGenerator<T> { @Override public boolean equals(Object other) { return EqualsBuilder.reflectionEquals(this, other); } ConstantGenerator(T value); @Override T next(); @Override boolean equals(Object other); @Override int hashCode(); @Override String toString(); }
ConstantGenerator extends AbstractGenerator<T> { @Override public boolean equals(Object other) { return EqualsBuilder.reflectionEquals(this, other); } ConstantGenerator(T value); @Override T next(); @Override boolean equals(Object other); @Override int hashCode(); @Override String toString();  }