@Test
    public void testSerializeNull() {
        //Object -> null
        AbstractByteBuf nullByteBuf = serializer.encode(null, null);
        DemoRequest nullObject = (DemoRequest) serializer.decode(nullByteBuf, DemoRequest.class, null);
        Assert.assertNull(nullObject);

        //String -> null
        AbstractByteBuf nullByteBuf2 = serializer.encode(null, null);
        String nullStr = (String) serializer.decode(nullByteBuf2, String.class, null);
        Assert.assertNull(nullStr);

        nullByteBuf2 = serializer.encode("xxx", null);
        nullStr = (String) serializer.decode(nullByteBuf2, String.class, null);
        Assert.assertEquals("xxx", nullStr);

        // int (...) -> init
        AbstractByteBuf nullByteBuf3 = serializer.encode(null, null);
        int nullInt = (int) serializer.decode(nullByteBuf3, int.class, null);
        Assert.assertEquals(0, nullInt);
    }
@author <a href="mailto:zhanggeng.zg@antfin.com">GengZhang</a>
codec/codec-jackson/src/test/java/com/alipay/sofa/rpc/codec/jackson/JacksonSerializerTest.java