@Test
    public void testStartupAndRegHandlers() {
        Server.help();
        Server server = Server.getInstance();
        server.initialize(0);
        LogSetup.clearHandlers();
        Thread serverThread = new Thread(server);
        serverThread.start();
        assertTrue(serverThread.isAlive());
        LogHandler handler = new LogDispatcherTestCase.MockHandler();
        server.registerLogHandler(handler, "foo");
        assertEquals(Server.threadNameForHandler().get(handler), "foo");
        server.unregisterLogHandler(handler);
        assertEquals(Server.threadNameForHandler().get(handler), null);
        serverThread.interrupt();
        try {
            serverThread.join();
            assertTrue(true);
        } catch (InterruptedException e) {
            fail();
        }
    }
Unit tests for the Server class.

@author Bjorn Borud
logserver/src/test/java/com/yahoo/logserver/ServerTestCase.java