ValueGenerators { public static <T> ValueGenerator<T> constant(@Nullable final T constant) { return new ValueGenerator<T>() { @Override public T nextValue() { return constant; } @Override public String toString() { return "ValueGenerators.constant(" + constant + ")"; } }; } private  ValueGenerators(); static SequenceValueGenerator sequence(); static ValueGenerator<T> constant(@Nullable final T constant); static StringSequenceValueGenerator stringSequence(@Nonnull String prefix); static DateSequenceValueGenerator dateSequence();  }
@Test public void contantShouldReturnGeneratorWhichGeneratesAConstantValue() { ValueGenerator<String> constantGenerator = ValueGenerators.constant("hello"); for (int i = 0; i < 3; i++) { assertEquals("hello", constantGenerator.nextValue()); } }