private void verifyWriteRaisesUve(short version,
                                      String problemText,
                                      Message message) {
        ObjectSerializationCache cache = new ObjectSerializationCache();
        UnsupportedVersionException e =
            assertThrows(UnsupportedVersionException.class, () -> {
                int size = message.size(cache, version);
                ByteBuffer buf = ByteBuffer.allocate(size);
                ByteBufferAccessor byteBufferAccessor = new ByteBufferAccessor(buf);
                message.write(byteBufferAccessor, cache, version);
            });
        assertTrue(e.getMessage().contains(problemText), "Expected to get an error message about " + problemText +
            ", but got: " + e.getMessage());
    }
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