### Question:
ConsoleListener { public void shutdown() { setReceived(SHUTDOWN); } 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 testShutdown() throws Exception { final Condition myCondition = new Condition(); final ConsoleListener listener = new ConsoleListener(myCondition, m_logger); final WaitForNotification notified = new WaitForNotification(myCondition); listener.shutdown(); assertTrue(notified.wasNotified()); verifyNoMoreInteractions(m_logger); assertFalse(listener.checkForMessage(ConsoleListener.ANY ^ ConsoleListener.SHUTDOWN)); assertTrue(listener.checkForMessage(ConsoleListener.SHUTDOWN)); assertTrue(listener.received(ConsoleListener.SHUTDOWN)); assertFalse(listener.checkForMessage(ConsoleListener.SHUTDOWN)); assertFalse(listener.received(ConsoleListener.SHUTDOWN)); }