### Question:
QueuedSenderDecorator implements QueuedSender { public void shutdown() { m_messageQueue.shutdown(); m_delegate.shutdown(); } QueuedSenderDecorator(Sender delegate); void send(Message message); @Override void flush(); void shutdown();  }### Answer:
@Test public void testShutdown() throws Exception { final StubSender sender = new StubSender(); final QueuedSender queuedSender = new QueuedSenderDecorator(sender); assertTrue(!sender.getIsShutdown()); queuedSender.shutdown(); assertTrue(sender.getIsShutdown()); try { queuedSender.send(new SimpleMessage()); fail("Expected CommunicationException"); } catch (CommunicationException e) { } try { queuedSender.flush(); fail("Expected CommunicationException"); } catch (CommunicationException e) { } }