@Override
    protected <T> void roundTrip(T message, Schema<T> schema,
            Pipe.Schema<T> pipeSchema) throws Exception
    {
        byte[] msgpack = MsgpackIOUtil.toByteArray(message, schema, numeric);

        ByteArrayInputStream jsonStream = new ByteArrayInputStream(msgpack);

        byte[] protostuff = ProtostuffIOUtil.toByteArray(
                MsgpackIOUtil.newPipe(msgpack, 0, msgpack.length, numeric), pipeSchema, buf());

        byte[] protostuffFromStream = ProtostuffIOUtil.toByteArray(
                MsgpackIOUtil.newPipe(jsonStream, numeric), pipeSchema, buf());

        assertTrue(Arrays.equals(protostuff, protostuffFromStream));

        T parsedMessage = schema.newMessage();
        ProtostuffIOUtil.mergeFrom(protostuff, parsedMessage, schema);
        SerializableObjects.assertEquals(message, parsedMessage);

        ByteArrayInputStream protostuffStream = new ByteArrayInputStream(protostuff);

        byte[] msgpackRoundTrip = MsgpackIOUtil.toByteArray(
                ProtostuffIOUtil.newPipe(protostuff, 0, protostuff.length), pipeSchema, numeric);

        byte[] msgpackRoundTripFromStream = MsgpackIOUtil.toByteArray(
                ProtostuffIOUtil.newPipe(protostuffStream), pipeSchema, numeric);

        assertTrue(msgpackRoundTrip.length == msgpackRoundTripFromStream.length);

        String strMsgpackRoundTrip = STRING.deser(msgpackRoundTrip);

        assertEquals(strMsgpackRoundTrip, STRING.deser(msgpackRoundTripFromStream));

        assertTrue(msgpackRoundTrip.length == msgpack.length);

        assertEquals(strMsgpackRoundTrip, STRING.deser(msgpack));
    }
Test runtime collection fields with {@link CollectionSchema} via msgpack.

@author Alex Shvid
protostuff-msgpack/src/test/java/io/protostuff/MsgpackRuntimeCollectionSchemaTest.java