private static SchemaVersion getSchemaVersion(byte[] schemaVersion) {
        if (schemaVersion != null) {
            return BytesSchemaVersion.of(schemaVersion);
        }
        return BytesSchemaVersion.of(new byte[0]);
    }
@Test
    public void decodeDataWithNullSchemaVersion() {
        Schema<GenericRecord> autoConsumeSchema = new AutoConsumeSchema();
        byte[] bytes = "bytes data".getBytes();
        MessageImpl<GenericRecord> message = MessageImpl.create(
                new MessageMetadata(), ByteBuffer.wrap(bytes), autoConsumeSchema, null);
        Assert.assertNull(message.getSchemaVersion());
        GenericRecord genericRecord = message.getValue();
        Assert.assertEquals(genericRecord.getNativeObject(), bytes);
    }