@Test
    public void testAll() throws IOException {
        ByteArrayOutputStream bout = new ByteArrayOutputStream();
        Hessian2Output h2out = new Hessian2Output(bout);
        h2out.setSerializerFactory(factory);

        Map map = new HashMap();
        map.put("1", new long[] { 1L, 2L });

        h2out.writeObject(map);

        h2out.flush();
        byte[] body = bout.toByteArray();

        ByteArrayInputStream input = new ByteArrayInputStream(body, 0, body.length);
        Hessian2Input hin = new Hessian2Input(input);

        Map copy = (Map) hin.readObject();

        long[] a1 = (long[]) map.get("1");
        long[] a2 = (long[]) copy.get("1");
        assertEquals(a1.length, a2.length);
        for (int i = 0; i < a1.length; ++i)
            assertEquals(a1[i], a2[i]);
    }
@author <a href="mailto:zhanggeng.zg@antfin.com">GengZhang</a>
codec/codec-sofa-hessian/src/test/java/com/alipay/sofa/rpc/codec/sofahessian/SingleClassLoaderSofaSerializerFactoryTest.java