public void testIt() throws IOException
    {
        RuntimeSchema.register(MainData.class);
        
        MainData testdata = new MainData("test", 123);
        ObjPackage obj = new ObjPackage();
        obj.setObj(testdata);
        testdata.put("aaaa", "bbb");
        Schema<ObjPackage> schema = RuntimeSchema.getSchema(ObjPackage.class);
        LinkedBuffer buffer = LinkedBuffer.allocate(256);
        ByteArrayOutputStream oss = new ByteArrayOutputStream(1024);
        
        GraphIOUtil.writeTo(oss, obj, schema, buffer);
        
        ObjPackage objParsed = schema.newMessage();
        GraphIOUtil.mergeFrom(oss.toByteArray(), objParsed, schema);
        
        assertTrue(objParsed.obj instanceof MainData);
        verifyEquals(testdata, (MainData)objParsed.obj);
        
        assertTrue(objParsed.data != null);
        verifyEquals(testdata, objParsed.data);
        
        assertTrue(objParsed.olist != null && 
                objParsed.olist.size() == 1 &&
                objParsed.olist.get(0) instanceof MainData);
        verifyEquals(testdata, (MainData)objParsed.olist.get(0));
        
        assertTrue(objParsed.list != null && 
                objParsed.list.size() == 1);
        verifyEquals(testdata, (MainData)objParsed.list.get(0));
        
        assertTrue(objParsed.omap != null && 
                objParsed.omap.size() == 1 &&
                objParsed.omap.get("obj") instanceof MainData);
        verifyEquals(testdata, (MainData)objParsed.omap.get("obj"));
        
        assertTrue(objParsed.map != null && 
                objParsed.map.size() == 1 &&
                objParsed.map.get("obj") instanceof MainData);
        verifyEquals(testdata, (MainData)objParsed.map.get("obj"));
    }
Lazy registration tests.

@author David Yu
@created Oct 29, 2016
protostuff-runtime/src/test/java/io/protostuff/runtime/LazyRegisterTest.java