@Test
    public void testReadWriteObjectNullAccessToken() {
        var profile = new OidcProfile();
        profile.setIdTokenString(ID_TOKEN);
        profile.setRefreshToken(new RefreshToken(REFRESH_TOKEN));
        var result = JAVA_SERIALIZER.serializeToBytes(profile);
        profile = (OidcProfile) JAVA_SERIALIZER.deserializeFromBytes(result);
        assertNull(profile.getAccessToken());
        assertEquals(profile.getIdTokenString(), ID_TOKEN);
        assertEquals(profile.getRefreshToken().getValue(), REFRESH_TOKEN);
    }
Test that serialization and deserialization of the OidcProfile work when the BearerAccessToken is null.
pac4j-oidc/src/test/java/org/pac4j/oidc/profile/OidcProfileTests.java