ClientTcpTransportHandler extends TransportHandler { @Override public void closeConnection() throws IOException { if (socket == null) { throw new IOException("Transporthandler is not initalized!"); } socket.close(); } ClientTcpTransportHandler(Connection connection);  ClientTcpTransportHandler(long timeout, String hostname, int port);  ClientTcpTransportHandler(long connectionTimeout, long timeout, String hostname, int port); @Override void closeConnection(); @Override void initialize(); @Override boolean isClosed(); @Override void closeClientConnection(); SocketState getSocketState();  }
@Test(expected = IOException.class) public void testCloseConnection() throws IOException { handler = new ClientTcpTransportHandler(100, "localhost", 0); handler.closeConnection(); }