static <SERIALIZED_CLASS extends Message, PROTO_SERIALIZABLE extends ProtoSerializable<SERIALIZED_CLASS>> Class<SERIALIZED_CLASS> getSerializedClass(PROTO_SERIALIZABLE protoSerializable) {
        @SuppressWarnings("unchecked")
        Class<SERIALIZED_CLASS> serializedClass = (Class<SERIALIZED_CLASS>) resolveTypeParameter(ProtoSerializable.class, protoSerializable.getClass(), ProtoSerializable.class.getTypeParameters()[0]);
        if (serializedClass != null) {
            return serializedClass;
        }
        String tpName = ProtoSerializable.class.getTypeParameters()[0].getName();
        throw new IllegalArgumentException("unable to resolve type parameter '" + tpName + "' in ProtoSerializable<" + tpName + "> for class " + protoSerializable.getClass().getName());
    }
@Test
    void testGetSerializedClass() throws Exception {
        CategoricalInfo ci = CategoricalInfoTest.generateProtoTestInfo();

        assertEquals(VariableInfoProto.class, ProtoUtil.getSerializedClass(ci));
        CategoricalIDInfo cidi = ci.makeIDInfo(12345);
        assertEquals(VariableInfoProto.class, ProtoUtil.getSerializedClass(cidi));
        VariableInfo ridi = new RealIDInfo("bob", 100, 1000.0, 0.0, 25.0, 125.0, 12345);
        assertEquals(VariableInfoProto.class, ProtoUtil.getSerializedClass(ridi));
        RealInfo ri = new RealInfo("bob", 100, 1000.0, 0.0, 25.0, 125.0);
        assertEquals(VariableInfoProto.class, ProtoUtil.getSerializedClass(ri));
        
        MutableFeatureMap mfm = new MutableFeatureMap(); 
        mfm.add("goldrat", 1.618033988749);
        mfm.add("e", Math.E);
        mfm.add("pi", Math.PI);
        HashedFeatureMap hfm = HashedFeatureMap.generateHashedFeatureMap(mfm, new MessageDigestHasher("SHA-512", "abcdefghi"));
        assertEquals(FeatureDomainProto.class, ProtoUtil.getSerializedClass(hfm));
        
        ModHashCodeHasher mdch = new ModHashCodeHasher(200, "abcdefghi");
        assertEquals(HasherProto.class, ProtoUtil.getSerializedClass(mdch));

        MessageDigestHasher mdh = new MessageDigestHasher("SHA-256", "abcdefghi");
        assertEquals(HasherProto.class, ProtoUtil.getSerializedClass(mdh));

        HashCodeHasher hch = new HashCodeHasher("abcdefghi");
        assertEquals(HasherProto.class, ProtoUtil.getSerializedClass(hch));

        assertEquals(CategoricalIDInfoProto.class, ProtoUtil.getSerializedClass(new PSC()));
        assertEquals(RealIDInfoProto.class, ProtoUtil.getSerializedClass(new PSD2()));
        assertEquals(RealIDInfoProto.class, ProtoUtil.getSerializedClass(new PSC2()));
        assertThrows(IllegalArgumentException.class, () -> ProtoUtil.getSerializedClass(new PSB2<RealInfoProto>()));
    }