### Question:
GeneratorOfInstance implements Generator<T> { @Override public T next() { return constantValue; } GeneratorOfInstance(T constantValue); @Override T next();  }### Answer:
@Test public void shouldGenerateConstantValue() { assertThat(new GeneratorOfInstance<>(A).next(), is(A)); assertThat(new GeneratorOfInstance<>(INT).next(), is(INT)); assertThat(new GeneratorOfInstance<>(NULL).next(), nullValue()); Object someObject = new Object(); assertThat(new GeneratorOfInstance<>(someObject).next(), sameInstance(someObject)); }