@Test
    public void testCanSerializeProfilesWithTimeValues() {
        val now = Instant.now();
        val profile = new CommonProfile();
        profile.setId(ID);
        profile.addAttribute("notOnOrAfter", now);
        val profiles = new LinkedHashMap<String, UserProfile>();
        profiles.put("myprofile", profile);

        val serializer = new JsonSerializer();
        val encoded = serializer.serializeToBytes(profiles);
        val decoded = serializer.deserializeFromBytes(encoded);

        assertEquals(LinkedHashMap.class, decoded.getClass());
        val profiles2 = (LinkedHashMap<String, UserProfile>) decoded;
        assertEquals(1, profiles2.size());
        assertEquals(profile, profiles2.get("myprofile"));
    }
Tests {@link Serializer}.

@author Jerome LELEU
@since 3.9.0
pac4j-core/src/test/java/org/pac4j/core/util/serializer/JsonSerializerTest.java