### Question:
TransformingGenerator implements Generator<T> { @Override public T next() { return function.apply(delegate.next()); } TransformingGenerator(@Nonnull Generator<F> delegate, @Nonnull Function<F, T> function); @Override T next();  }### Answer:
@Test public void shouldTransformGeneratedValueUsingSuppliedFunction() { Generator<String> intAsStringGenerator = new TransformingGenerator<>(Generators.ofInstance(5), new Function<Integer, String>() { @Override public String apply(Integer input) { return input.toString(); } }); assertThat(intAsStringGenerator.next(), is("5")); }