private UserProfile assertToken(FacebookProfile profile, String token, Authenticator authenticator) {
        val credentials = new TokenCredentials(token);
        authenticator.validate(null, credentials);
        val profile2 = credentials.getUserProfile();
        assertTrue(profile2 instanceof FacebookProfile);
        val fbProfile = (FacebookProfile) profile2;
        assertEquals(profile.getTypedId(), fbProfile.getTypedId());
        assertEquals(profile.getFirstName(), fbProfile.getFirstName());
        assertEquals(profile.getDisplayName(), fbProfile.getDisplayName());
        assertEquals(profile.getFamilyName(), fbProfile.getFamilyName());
        assertEquals(profile.getVerified(), fbProfile.getVerified());
        return profile2;
    }
This class tests the {@link JwtGenerator} and {@link JwtAuthenticator}.

@author Jerome Leleu
@since 1.8.0
pac4j-jwt/src/test/java/org/pac4j/jwt/JwtTests.java