public void testListAllMessages() throws Exception {
MessageHandler inHandler = mock(MessageHandler.class);
when(inHandler.listMessages(any(Connection.class), any(MessageCriteria.class)))
.thenReturn(Collections.singleton(new Message()));
MessageHandler outHandler = mock(MessageHandler.class);
when(outHandler.listMessages(any(Connection.class), any(MessageCriteria.class)))
.thenReturn(Collections.singleton(new Message()));
Connection conn = mock(Connection.class);
MessageHandler handler = createMessageHandler(outHandler, inHandler);