public int hashCode() {
        return (getPrincipals() != null ? getPrincipals().hashCode() : 0);
    }
If the {@link #getPrincipals() principals} are not null, returns <code>principals.hashCode()</code>, otherwise
returns 0 (zero).

@return <code>principals.hashCode()</code> if they are not null, 0 (zero) otherwise.
core/src/main/java/org/apache/shiro/authc/SimpleAccount.java