StreamTransportHandler extends TransportHandler { @Override public void closeConnection() throws IOException { if (isInitialized()) { try { inputStream.close(); } catch (IOException E) { throw new IOException("Could not close StreamTransportHandler"); } try { inputStream.close(); } catch (IOException E) { throw new IOException("Could not close StreamTransportHandler"); } } else { throw new IOException("Could not close StreamTransportHandler. Not Initialised"); } closed = true; } StreamTransportHandler(long timeout, ConnectionEndType type, InputStream inputStream,
            OutputStream outputStream); @Override void closeConnection(); @Override void initialize(); InputStream getInputStream(); OutputStream getOutputStream(); @Override boolean isClosed(); @Override void closeClientConnection();  }
@Test(expected = IOException.class) public void testCloseConnection() throws IOException { handler.closeConnection(); }