private void verifyWriteSucceeds(short version, Message message) {
        ObjectSerializationCache cache = new ObjectSerializationCache();
        int size = message.size(cache, version);
        ByteBuffer buf = ByteBuffer.allocate(size * 2);
        ByteBufferAccessor byteBufferAccessor = new ByteBufferAccessor(buf);
        message.write(byteBufferAccessor, cache, version);
        assertEquals(size, buf.position(), "Expected the serialized size to be " + size + ", but it was " + buf.position());
    }
Verify that the JSON files support the same message versions as the
schemas accessible through the ApiKey class.
clients/src/test/java/org/apache/kafka/common/message/MessageTest.java