@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)); }
@Override public T next() { return constantValue; }
GeneratorOfInstance implements Generator<T> { @Override public T next() { return constantValue; } }
GeneratorOfInstance implements Generator<T> { @Override public T next() { return constantValue; } GeneratorOfInstance(T constantValue); }
GeneratorOfInstance implements Generator<T> { @Override public T next() { return constantValue; } GeneratorOfInstance(T constantValue); @Override T next(); }
GeneratorOfInstance implements Generator<T> { @Override public T next() { return constantValue; } GeneratorOfInstance(T constantValue); @Override T next();  }