TextServer extends Thread { public void stopServer() { stopping = true; closeServer(); closeClient(); interrupt(); LOGGER.info("text server stopped"); } TextServer(final String hostname, final int serverPort);  TextServer(final int serverPort); void setAutoAcknowledge(final boolean value); void addTextListener(final TextListener textListener); ConnectionInformation getConnectionInformation(); @Override void run(); boolean isStarted(); void acknowledge(final int seq); void waitStarted(); void waitConnected(); void sendInput(final String input); void stopServer(); boolean isConnected();  }
@Test public void testStopServer() { Assert.assertTrue(server.isStarted()); server.stopServer(); Assert.assertFalse(server.isStarted()); }