@Test
    public void testAscendingOrder() {
		try {
			msg1 = LogMessage.parseNativeFormat(msgstr1.trim());
			msg2 = LogMessage.parseNativeFormat(msgstr2.trim());
		} catch (InvalidLogFormatException e) {
			fail();
		}
		Set<LogMessage> msglist = new TreeSet<LogMessage>(new LogMessageTimeComparator());
		msglist.add(msg1);
		msglist.add(msg2);

		Iterator<LogMessage> it = msglist.iterator();
		assertEquals(msg1, it.next());
		assertEquals(msg2, it.next());
	}
Unit test for the LogMessage TimeComparator

@author vlarsen
vespalog/src/test/java/com/yahoo/log/TimeComparatorTestCase.java