@Test
    void verifyPrincipalAffectsHash() throws Throwable {
        val credential = new SpnegoCredential(ArrayUtils.EMPTY_BYTE_ARRAY);
        val hash1 = credential.hashCode();
        val principal = PrincipalFactoryUtils.newPrincipalFactory().createPrincipal("test");
        credential.setPrincipal(principal);
        val hash2 = credential.hashCode();
        assertNotEquals(hash1, hash2);
    }
Make sure that when the Principal becomes populated / changes we return a new hash
support/cas-server-support-spnego/src/test/java/org/apereo/cas/support/spnego/authentication/principal/SpnegoCredentialsTests.java