@Test
    public void testCustomThrowableDeserializer() throws Exception {
        GenericMultipleClassLoaderSofaSerializerFactory factory = new GenericMultipleClassLoaderSofaSerializerFactory();

        ByteArrayOutputStream bsOut = new ByteArrayOutputStream();
        Hessian2Output hessian2Output = new Hessian2Output(bsOut);
        hessian2Output.setSerializerFactory(factory);

        MockError mockError = new MockError("MockError");
        hessian2Output.writeObject(mockError);
        hessian2Output.flush();

        Deserializer genericDeserializer = factory.getDeserializer(MockError.class.getName());
        Assert.assertTrue(genericDeserializer instanceof GenericDeserializer);

        ByteArrayInputStream bsIn = new ByteArrayInputStream(bsOut.toByteArray());
        Hessian2Input hessian2Input = new Hessian2Input(bsIn);
        hessian2Input.setSerializerFactory(factory);
        Object result = hessian2Input.readObject();
        Assert.assertTrue(result instanceof GenericObject);
    }
@author <a href="mailto:zhanggeng.zg@antfin.com">GengZhang</a>
codec/codec-sofa-hessian/src/test/java/com/alipay/sofa/rpc/codec/sofahessian/GenericMultipleClassLoaderSofaSerializerFactoryTest.java