List<Message> content = listener.getBuffer();
assertEquals(first.messageId(), content.get(0).messageId());
assertEquals(second.messageId(),content.get(1).messageId());
assertEquals(third.messageId(), content.get(2).messageId());
assertEquals(fourth.messageId(), content.get(3).messageId());
assertEquals(fifth.messageId(), content.get(4).messageId());
}
@Test
public void testGarbageCollect() throws InvalidKeyException, SignatureException, IOException, InterruptedException {
CountingBufferListener listener = new CountingBufferListener();