@Test
    public void testCompare() {
        JID jid1 = new JID("john@mycomapny.com");
        JID jid2 = new JID("john@mycomapny.com");
        assertEquals(0 , jid1.compareTo(jid2), "Failed to compare 2 similar JIDs");
        assertEquals(jid1, jid2, "Failed to recognize equal JIDs");

        jid1 = new JID("john@mycomapny.com");
        jid2 = new JID("mycomapny.com");
        assertTrue(jid1.compareTo(jid2) > 0, "Failed to recognized bigger JID");
        assertNotEquals(jid1, jid2, "Failed to recognize different JIDs");

        jid1 = new JID("john@mycomapny.com");
        jid2 = new JID("mycomapny.com/resource");
        assertTrue(jid1.compareTo(jid2) > 0, "Failed to recognized bigger JID");
        assertNotEquals(jid1, jid2, "Failed to recognize different JIDs");

        jid1 = new JID("john@mycomapny.com");
        jid2 = new JID("john@mycomapny.com/resource");
        assertTrue(jid1.compareTo(jid2) < 0, "Failed to recognized bigger JID");
        assertNotEquals(jid1, jid2, "Failed to recognize different JIDs");
    }
Test cases for the JID class.

@author Gaston Dombiak
xmppserver/src/test/java/org/jivesoftware/util/JIDTest.java