@Override
        public void onCompletion(RecordMetadata metadata, Exception exception) {
            invocations++;
            this.metadata = metadata;
            this.exception = exception;
        }
This tests that leader is correctly maintained & leader-change is correctly detected across retries
of the batch. It does so by testing primarily testing methods
1. maybeUpdateLeaderEpoch
2. hasLeaderChangedForTheOngoingRetry
clients/src/test/java/org/apache/kafka/clients/producer/internals/ProducerBatchTest.java