@Override
    public int compareTo(JID jid) {
        // Comparison order is domain, node, resource.
        int compare = getDomain().compareTo(jid.getDomain());
        if (compare == 0) {
            String otherNode = jid.getNode();
            compare = otherNode == null ? 1 : getGroupName().compareTo(otherNode);
        }
        if (compare == 0) {
            compare = jid.getResource() == null ? 0 : -1;
        }
        return compare;
    }
Override the base class implementation to retain the resource
identifier for group JIDs.

@return The full JID rendered as a string
xmppserver/src/main/java/org/jivesoftware/openfire/group/GroupJID.java