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