### Question:
RecordMetadata { @Deprecated public long checksum() { if (checksum == null) this.checksum = DefaultRecord.computePartialChecksum(timestamp, serializedKeySize, serializedValueSize); return this.checksum; } RecordMetadata(TopicPartition topicPartition, long baseOffset, long relativeOffset, long timestamp,
                          Long checksum, int serializedKeySize, int serializedValueSize); @Deprecated  RecordMetadata(TopicPartition topicPartition, long baseOffset, long relativeOffset, long timestamp,
                          long checksum, int serializedKeySize, int serializedValueSize); long offset(); long timestamp(); @Deprecated long checksum(); int serializedKeySize(); int serializedValueSize(); String topic(); int partition(); @Override String toString(); static final int UNKNOWN_PARTITION; }### Answer:
@Test @SuppressWarnings("deprecation") public void testNullChecksum() { long timestamp = 2340234L; int keySize = 3; int valueSize = 5; RecordMetadata metadata = new RecordMetadata(new TopicPartition("foo", 0), 15L, 3L, timestamp, null, keySize, valueSize); assertEquals(DefaultRecord.computePartialChecksum(timestamp, keySize, valueSize), metadata.checksum()); }