@Test(expected = BackwardsClockDriftException.class) public void nextSequenceNumberShouldThrowBackwardsClockDriftExceptionIfDriftIsDetected() { final SequenceConfig config = SequenceConfig.create(65536) .withTimeProvider(new DriftingTimeProvider()) .build(); final Sequence provider = new Sequence(config); provider.nextSequenceNumber(); provider.nextSequenceNumber(); }
public SequenceNumber nextSequenceNumber() { synchronized (lock) { final long tick = updateCounter(); return new SequenceNumber(tick, sequenceToByteArray()); } }
Sequence { public SequenceNumber nextSequenceNumber() { synchronized (lock) { final long tick = updateCounter(); return new SequenceNumber(tick, sequenceToByteArray()); } } }
Sequence { public SequenceNumber nextSequenceNumber() { synchronized (lock) { final long tick = updateCounter(); return new SequenceNumber(tick, sequenceToByteArray()); } } Sequence(final SequenceConfig config); }
Sequence { public SequenceNumber nextSequenceNumber() { synchronized (lock) { final long tick = updateCounter(); return new SequenceNumber(tick, sequenceToByteArray()); } } Sequence(final SequenceConfig config); SequenceNumber nextSequenceNumber(); }
Sequence { public SequenceNumber nextSequenceNumber() { synchronized (lock) { final long tick = updateCounter(); return new SequenceNumber(tick, sequenceToByteArray()); } } Sequence(final SequenceConfig config); SequenceNumber nextSequenceNumber();  }