### Question:
SocketWrapper implements ResourcePool.Resource { public void close() { if (!m_socket.isClosed()) { synchronized (m_outputStream) { new StreamSender(m_outputStream).shutdown(); } Closer.close(m_socket); m_closedListeners.apply(m_closedInformer); } } SocketWrapper(Socket socket); void close(); boolean isClosed(); ConnectionIdentity getConnectionIdentity(); InputStream getInputStream(); OutputStream getOutputStream(); void addClosedListener(ClosedListener listener); void setAddress(Address address); Address getAddress();  }### Answer:
@Test(expected=CommunicationException.class) public void testConstructionWithBadSocket() throws Exception { m_socket.close(); new SocketWrapper(m_socket); }