JID jid = (JID)object; if (jid == object) {
if (this == object) {
    public boolean equals(Object object) {        if (!(object instanceof JID)) {            return false;        }        JID jid = (JID)object;        if (jid == object) {            return true;        }        // Node. If node isn't null, compare.        if (node != null) {            if (!node.equals(jid.node)) {                return false;            }        }        // Otherwise, jid.node must be null.        else if (jid.node != null) {            return false;        }        // Compare domain, which must be null.        if (!domain.equals(jid.domain)) {            return false;        }        // Resource. If resource isn't null, compare.        if (resource != null) {            if (!resource.equals(jid.resource)) {                return false;            }        }        // Otherwise, jid.resource must be null.        else if (jid.resource != null) {            return false;        }        // Passed all checks, so equal.        return true;    }