@Test
    @Deprecated // This tests a deprecated implementation. A test for the replacement code already exists. Simply delete this when the deprecated code gets removed.
    public void testDifferentPriorities() throws Exception {
        // setup
        final DNSUtil.WeightedHostAddress hostA = new DNSUtil.WeightedHostAddress("hostA", 5222, false, 1, 1);
        final DNSUtil.WeightedHostAddress hostB = new DNSUtil.WeightedHostAddress("hostB", 5222, false, 3, 1);
        final DNSUtil.WeightedHostAddress hostC = new DNSUtil.WeightedHostAddress("hostC", 5222, false, 2, 1);

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

        // verify
        assertEquals(3, result.size());
        assertEquals(hostA, result.get(0));
        assertEquals(hostC, result.get( 1 ));
        assertEquals(hostB, result.get(2));
    }
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/DNSUtilTest.java