### Question:
SequentialIntegerGenerator implements Generator<Integer> { @Override public Integer next() { return value.getAndAdd(1); } SequentialIntegerGenerator(int startAt);  SequentialIntegerGenerator(); @Override Integer next();  }### Answer:
@Test public void shouldGenerateIntegersInSequence() throws Exception { generator = new SequentialIntegerGenerator(); List<Integer> generatedValues = newArrayList(); for (int i = 0; i < 10; i++) { generatedValues.add(generator.next()); } assertThat(generatedValues, contains(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)); }
@Test public void shouldStartAtOffset() throws Exception { generator = new SequentialIntegerGenerator(2); Integer generatedValue = generator.next(); assertThat(generatedValue, is(2)); }