### Question:
FromBuilderGenerator implements Generator<T> { @Override public T next() { return builder.build(); } FromBuilderGenerator(@Nonnull Builder<T> builder); @Override T next();  }### Answer:
@Test public void shouldGenerateTypeUsingBuilder() { given(carBuilder.build()).willReturn(car1, car2, car3); Generator<Car> fromBuilderGenerator = new FromBuilderGenerator<>(carBuilder); assertThat(fromBuilderGenerator.next(), sameInstance(car1)); assertThat(fromBuilderGenerator.next(), sameInstance(car2)); assertThat(fromBuilderGenerator.next(), sameInstance(car3)); }