public void testBazStreamed() throws Exception
    {

        for (Baz bazCompare : new Baz[] { baz, negativeBaz })
        {
            ByteArrayOutputStream out = new ByteArrayOutputStream();
            LinkedBuffer buffer = buf();
            try
            {
                MsgpackXIOUtil.writeTo(out, bazCompare, BAZ_SCHEMA, true, buffer);
            }
            finally
            {
                buffer.clear();
            }
            byte[] xdata = out.toByteArray();
            byte[] data = MsgpackIOUtil.toByteArray(bazCompare, BAZ_SCHEMA, true);

            Assert.assertTrue(Arrays.equals(data, xdata));
        }
    }
Test for MsgpackXOutput on runtime pojos (polymorphic too).

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