@Test
    public void testMessageCount() {
        MockHandler handler = new MockHandler();
        LogDispatcher dispatcher = new LogDispatcher();
        dispatcher.registerLogHandler(handler);
        assertEquals(0, dispatcher.getMessageCount());

        dispatcher.handle(sample1);
        assertEquals(1, dispatcher.getMessageCount());

        dispatcher.handle(sample2);
        assertEquals(2, dispatcher.getMessageCount());

        assertEquals(2, handler.messages.size());
    }
Unit tests for thge LogMessage class.

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