### Question:
ClientSender extends StreamSender implements BlockingSender { @Override public void shutdown() { m_socketWrapper.close(); super.shutdown(); } private  ClientSender(SocketWrapper socketWrapper); static ClientSender connect(Connector connector, Address address); static ClientSender connect(ClientReceiver clientReceiver); @Override void shutdown(); Message blockingSend(Message message); void sendKeepAlive();  }### Answer:
@Test public void testShutdown() throws Exception { final SocketAcceptorThread socketAcceptor = SocketAcceptorThread.create(); final Connector connector = new Connector(socketAcceptor.getHostName(), socketAcceptor.getPort(), ConnectionType.AGENT); final Sender clientSender = ClientSender.connect(connector, null); socketAcceptor.join(); final Message message = new SimpleMessage(); clientSender.send(message); clientSender.shutdown(); try { clientSender.send(message); fail("Expected CommunicationException"); } catch (CommunicationException e) { } final InputStream socketInput = socketAcceptor.getAcceptedSocket().getInputStream(); assertEquals(ConnectionType.AGENT, Connector.read(socketInput).getConnectionType()); final ObjectInputStream inputStream1 = new ObjectInputStream(socketInput); final Object o1 = inputStream1.readObject(); assertNotNull(o1); final ObjectInputStream inputStream2 = new ObjectInputStream(socketInput); final Object o2 = inputStream2.readObject(); assertTrue(o2 instanceof CloseCommunicationMessage); socketAcceptor.close(); }