### Question:
RaftSessionSequencer { public void sequenceEvent(PublishRequest request, Runnable callback) { if (requestSequence == responseSequence) { log.trace("Completing {}", request); callback.run(); eventIndex = request.eventIndex(); } else { eventCallbacks.add(new EventCallback(request, callback)); completeResponses(); } } RaftSessionSequencer(RaftSessionState state); long nextRequest(); void sequenceEvent(PublishRequest request, Runnable callback); void sequenceResponse(long sequence, OperationResponse response, Runnable callback);  }### Answer:
@Test public void testSequenceEventAbsentCommand() throws Throwable { RaftSessionSequencer sequencer = new RaftSessionSequencer(new RaftSessionState("test", SessionId.from(1), UUID.randomUUID().toString(), TestPrimitiveType.instance(), 1000)); PublishRequest request1 = PublishRequest.builder() .withSession(1) .withEventIndex(2) .withPreviousIndex(0) .withEvents(Collections.emptyList()) .build(); PublishRequest request2 = PublishRequest.builder() .withSession(1) .withEventIndex(3) .withPreviousIndex(2) .withEvents(Collections.emptyList()) .build(); AtomicInteger run = new AtomicInteger(); sequencer.sequenceEvent(request1, () -> assertEquals(0, run.getAndIncrement())); sequencer.sequenceEvent(request2, () -> assertEquals(1, run.getAndIncrement())); assertEquals(2, run.get()); }