public static long producerRecordSizeInBytes(final ProducerRecord<byte[], byte[]> record) {
        return recordSizeInBytes(
            record.key() == null ? 0 : record.key().length,
            record.value() == null ? 0 : record.value().length,
            record.topic(),
            record.headers()
        );
    }
@Test
    public void shouldComputeSizeInBytesForProducerRecordWithNullKey() {
        final ProducerRecord<byte[], byte[]> record = new ProducerRecord<>(
            TOPIC,
            1,
            0L,
            null,
            VALUE,
            HEADERS
        );
        assertThat(producerRecordSizeInBytes(record), equalTo(NULL_KEY_SIZE_IN_BYTES));
    }