@Test
    public void testBytesSerializationTrustedClass() {
        var h = new JavaSerializer();
        h.clearTrustedPackages();
        h.clearTrustedClasses();
        h.addTrustedClass(SimplePrincipalCollection.class);
        val spc = new SimplePrincipalCollection();
        val serialized = h.serializeToBytes(spc);
        assertEquals(spc, h.deserializeFromBytes(serialized));
    }
Tests {@link JavaSerializer}.

@author Jerome Leleu
@since 1.8.1
pac4j-core/src/test/java/org/pac4j/core/util/serializer/JavaSerializerTests.java