public void print(final ByteBuffer encodedMessage, final StringBuilder output)
    {
        final UnsafeBuffer buffer = new UnsafeBuffer(encodedMessage);
        print(output, buffer, 0);
    }
@Test
    void exampleMessagePrintedAsJson() throws Exception
    {
        final ByteBuffer encodedSchemaBuffer = ByteBuffer.allocate(SCHEMA_BUFFER_CAPACITY);
        encodeSchema(encodedSchemaBuffer);

        final ByteBuffer encodedMsgBuffer = ByteBuffer.allocate(MSG_BUFFER_CAPACITY);
        encodeTestMessage(encodedMsgBuffer);

        encodedSchemaBuffer.flip();
        final Ir ir = decodeIr(encodedSchemaBuffer);

        final JsonPrinter printer = new JsonPrinter(ir);
        final String result = printer.print(encodedMsgBuffer);
        assertEquals(
            "{\n" +
            "    \"serialNumber\": 1234,\n" +
            "    \"modelYear\": 2013,\n" +
            "    \"available\": \"T\",\n" +
            "    \"code\": \"A\",\n" +
            "    \"someNumbers\": [0, 1, 2, 3, 4],\n" +
            "    \"vehicleCode\": \"ab\\\"def\",\n" +
            "    \"extras\": { \"sunRoof\": false, \"sportsPack\": true, \"cruiseControl\": true },\n" +
            "    \"engine\": \n" +
            "    {\n" +
            "        \"capacity\": 2000,\n" +
            "        \"numCylinders\": 4,\n" +
            "        \"maxRpm\": 9000,\n" +
            "        \"manufacturerCode\": \"123\",\n" +
            "        \"fuel\": \"Petrol\"\n" +
            "    },\n" +
            "    \"uuid\": [7, 3],\n" +
            "    \"cupHolderCount\": 5,\n" +
            "    \"fuelFigures\": [\n" +
            "    {\n" +
            "        \"speed\": 30,\n" +
            "        \"mpg\": 35.9\n" +
            "    },\n" +
            "    {\n" +
            "        \"speed\": 55,\n" +
            "        \"mpg\": 49.0\n" +
            "    },\n" +
            "    {\n" +
            "        \"speed\": 75,\n" +
            "        \"mpg\": 40.0\n" +
            "    }],\n" +
            "    \"performanceFigures\": [\n" +
            "    {\n" +
            "        \"octaneRating\": 95,\n" +
            "        \"acceleration\": [\n" +
            "        {\n" +
            "            \"mph\": 30,\n" +
            "            \"seconds\": 4.0\n" +
            "        },\n" +
            "        {\n" +
            "            \"mph\": 60,\n" +
            "            \"seconds\": 7.5\n" +
            "        },\n" +
            "        {\n" +
            "            \"mph\": 100,\n" +
            "            \"seconds\": 12.2\n" +
            "        }]\n" +
            "    },\n" +
            "    {\n" +
            "        \"octaneRating\": 99,\n" +
            "        \"acceleration\": [\n" +
            "        {\n" +
            "            \"mph\": 30,\n" +
            "            \"seconds\": 3.8\n" +
            "        },\n" +
            "        {\n" +
            "            \"mph\": 60,\n" +
            "            \"seconds\": 7.1\n" +
            "        },\n" +
            "        {\n" +
            "            \"mph\": 100,\n" +
            "            \"seconds\": 11.8\n" +
            "        }]\n" +
            "    }],\n" +
            "    \"manufacturer\": \"Honda\",\n" +
            "    \"model\": \"Civic VTi\",\n" +
            "    \"activationCode\": \"315\\\\8\"\n" +
            "}",
            result);
    }