}
public void testHistory() throws Exception {
assertEquals(0, myDispatcher.getHistory(myUser, null).length);
MockMessage message = new MockMessage();
myDispatcher.addPendingMessage(myUser, message);
assertEquals(1, myDispatcher.getPendingMessages(myUser).length);
assertEquals(0, myDispatcher.getHistory(myUser, null).length);
myDispatcher.sendNow(myUser, message);
assertEquals(0, myDispatcher.getPendingMessages(myUser).length);
assertEquals(1, myDispatcher.getHistory(myUser, null).length);
MockMessage message2 = new MockMessage();
myDispatcher.sendNow(myUser, message2);
LocalMessage[] history = myDispatcher.getHistory(myUser, null);
assertEquals(2, history.length);
assertSame(message, history[0]);