@Test
    public void testOAuth20Credentials() {
        val realAccessToken = new OAuth2AccessToken(UUID.randomUUID().toString(), "{'access_token': 'abc'}");
        val credentials = new OAuth20Credentials(UUID.randomUUID().toString());
        credentials.setAccessToken(OAuth20Credentials.OAuth20AccessToken.from(realAccessToken));
        val javaSerializer = new JavaSerializer();
        val bytes = javaSerializer.serializeToBytes(credentials);
        val credentials2 = (OAuth20Credentials) javaSerializer.deserializeFromBytes(bytes);
        assertEquals(credentials2, credentials);
    }
This class tests the {@link OAuth20Credentials} class.

@author Misagh Moayyed
@since 6.0.5
pac4j-oauth/src/test/java/org/pac4j/oauth/credentials/OAuth20CredentialsTests.java