### Question:
ConsoleListener { public StartGrinderMessage getLastStartGrinderMessage() { return m_lastStartGrinderMessage; } ConsoleListener(Condition notifyOnMessage, Logger logger); void shutdown(); void waitForMessage(); boolean checkForMessage(int mask); void discardMessages(int mask); synchronized boolean received(int mask); void registerMessageHandlers(
    MessageDispatchRegistry messageDispatcher); StartGrinderMessage getLastStartGrinderMessage(); static final int START; static final int RESET; static final int STOP; static final int SHUTDOWN; static final int ANY; }### Answer:
@Test public void testGetLastStartGrinderMessage() throws Exception { final ConsoleListener listener = new ConsoleListener(new Condition(), m_logger); final Message m1 = new StartGrinderMessage(new GrinderProperties(), -1); final Message m2 = new StartGrinderMessage(new GrinderProperties(), -1); final Message m3 = new MyMessage(); final MessageDispatchSender messageDispatcher = new MessageDispatchSender(); listener.registerMessageHandlers(messageDispatcher); assertNull(listener.getLastStartGrinderMessage()); messageDispatcher.send(m1); assertEquals(m1, listener.getLastStartGrinderMessage()); messageDispatcher.send(m3); assertEquals(m1, listener.getLastStartGrinderMessage()); messageDispatcher.send(m2); assertEquals(m2, listener.getLastStartGrinderMessage()); }