### Question:
MessagePublisher implements AutoCloseable { public synchronized List<Message> messageQuery(long from, long to) { return archive.messageQuery(from, to); } MessagePublisher(String name, Route route, List<MessageProducer> producers); String getName(); synchronized void close(); synchronized List<Message> messageQuery(long from, long to); Route getRoute();  }### Answer:
@Test public void messageQuery() { try { assertEquals(messageList, messagePublisher.messageQuery(System.currentTimeMillis()-1, System.currentTimeMillis())); Mockito.verify(messageArchive, atLeastOnce()).messageQuery(anyLong(), anyLong()); } catch (Exception e) { fail("This should not happen"); } }