public boolean equals(Object o) {
        if (o == this) {
            return true;
        }
        if (o instanceof SimpleAccount) {
            SimpleAccount sa = (SimpleAccount) o;
            //principal should be unique across the application, so only check this for equality:
            return (getPrincipals() != null ? getPrincipals().equals(sa.getPrincipals()) : sa.getPrincipals() == null);
        }
        return false;
    }
Returns <code>true</code> if the specified object is also a {@link SimpleAccount SimpleAccount} and its
{@link #getPrincipals() principals} are equal to this object's <code>principals</code>, <code>false</code> otherwise.

@param o the object to test for equality.
@return <code>true</code> if the specified object is also a {@link SimpleAccount SimpleAccount} and its
{@link #getPrincipals() principals} are equal to this object's <code>principals</code>, <code>false</code> otherwise.
core/src/main/java/org/apache/shiro/authc/SimpleAccount.java