Retransmitter implements Service { private void resend(MessageStoreResult result, long fromSeqNo, final FixpSession session) throws IOException { int count = batchSize(result, fromSeqNo); List<ByteBuffer> list = result.getMessageList(fromSeqNo, count); ByteBuffer[] array = new ByteBuffer[count]; array = list.toArray(array); session.resend(array, 0, count, fromSeqNo, result.getRequestTimestamp()); } Retransmitter(EventReactor<ByteBuffer> reactor, MessageStore store, Sessions sessions,
      ExceptionConsumer exceptionConsumer); void close(); CompletableFuture<Retransmitter> open();  }
@Test public void testRetransmit() throws StoreException, InterruptedException, IOException { assertEquals(session, sessions.getSession(uuid)); ByteBuffer message = ByteBuffer.allocate(1024); message.put("The quick brown fox".getBytes()); for (long seqNo = 1; seqNo < 1001; seqNo++) { store.insertMessage(uuid, seqNo, message); } notifyGap(350, 20); Thread.sleep(2000); ArgumentCaptor<ByteBuffer[]> messages = ArgumentCaptor.forClass(ByteBuffer[].class); ArgumentCaptor<Long> timestamp = ArgumentCaptor.forClass(Long.class); verify(session).resend(messages.capture(), anyInt(), anyInt(), anyLong(), timestamp.capture()); assertTrue(messages.getValue().length > 0); assertEquals(lastRequestTimestamp, timestamp.getValue().longValue()); }