@Test public void shouldCycle() throws Exception { List<Integer> generatedValues = newArrayList(); for (int i = 0; i < 10; i++) { generatedValues.add(generator.next()); } assertThat(generatedValues, contains(3, 4, 5, 3, 4, 5, 3, 4, 5, 3)); }
@Override public T next() { return iterator.next(); }
CyclicGenerator implements Generator<T> { @Override public T next() { return iterator.next(); } }
CyclicGenerator implements Generator<T> { @Override public T next() { return iterator.next(); } @SafeVarargs  CyclicGenerator(@Nonnull T first, @Nonnull T... rest); }
CyclicGenerator implements Generator<T> { @Override public T next() { return iterator.next(); } @SafeVarargs  CyclicGenerator(@Nonnull T first, @Nonnull T... rest); @Override T next(); }
CyclicGenerator implements Generator<T> { @Override public T next() { return iterator.next(); } @SafeVarargs  CyclicGenerator(@Nonnull T first, @Nonnull T... rest); @Override T next();  }