public boolean isDone() {
        return finalState() != null;
    }
Check if the batch has been completed (either successfully or exceptionally).
@return `true` if the batch has been completed, `false` otherwise.
clients/src/main/java/org/apache/kafka/clients/producer/internals/ProducerBatch.java