public boolean transactionInitialized() {
        return this.transactionInitialized;
    }
Set a mock metric for testing purpose
clients/src/main/java/org/apache/kafka/clients/producer/MockProducer.java