@Test
    public void testDifferentPriorities() throws Exception {
        // setup
        final SrvRecord hostA = new SrvRecord("hostA", 5222, false, 1, 1);
        final SrvRecord hostB = new SrvRecord("hostB", 5222, false, 3, 1);
        final SrvRecord hostC = new SrvRecord("hostC", 5222, false, 2, 1);

        // do magic
        final List<Set<SrvRecord>> result = SrvRecord.prioritize(new SrvRecord[]{hostA, hostB, hostC});

        // verify
        assertEquals(3, result.size());
        assertEquals(hostA, result.get(0).iterator().next());
        assertEquals(hostC, result.get(1).iterator().next());
        assertEquals(hostB, result.get(2).iterator().next());
    }
Verifies that when a couple of records exist that all have a particular priority, those records are all included
in the result, ordered (ascending) by their priority.
xmppserver/src/test/java/org/jivesoftware/openfire/net/SrvRecordTest.java