ServerTcpTransportHandler extends TransportHandler { @Override public void closeConnection() throws IOException { if (socket != null) { socket.close(); } if (serverSocket != null) { serverSocket.close(); } else if (!externalServerSocket) { throw new IOException("TransportHandler not initialised"); } } ServerTcpTransportHandler(long timeout, int port);  ServerTcpTransportHandler(long timeout, ServerSocket serverSocket);  ServerTcpTransportHandler(long timeout, Socket socket); void closeServerSocket(); @Override void closeConnection(); @Override void initialize(); @Override boolean isClosed(); ServerSocket getServerSocket(); @Override void closeClientConnection(); int getPort();  }
@Test(expected = IOException.class) public void testCloseConnection() throws IOException { handler.closeConnection(); }