@Test
    public void testBytesSerializationTrustedPackage() {
        var h = new JavaSerializer();
        h.addTrustedPackage("org.apache");
        val spc = new SimplePrincipalCollection();
        val serialized = h.serializeToBytes(spc);
        assertNotNull(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