SequenceValueGenerator implements ValueGenerator<Long> { @Override public Long nextValue() { long result = next; next += increment; return result; } SequenceValueGenerator(); private  SequenceValueGenerator(long start, int increment); SequenceValueGenerator startingAt(long start); SequenceValueGenerator incrementingBy(int increment); @Override Long nextValue(); @Override String toString();  }
@Test public void startsAtOne() { assertEquals(1L, ValueGenerators.sequence().nextValue().longValue()); }
@Test public void incrementsByOne() { SequenceValueGenerator sequence = ValueGenerators.sequence(); sequence.nextValue(); assertEquals(2L, sequence.nextValue().longValue()); }