public void addBatch(short producerEpoch, int lastSeq, long lastOffset, int offsetDelta, long timestamp) {
        maybeUpdateProducerEpoch(producerEpoch);
        addBatchMetadata(new BatchMetadata(lastSeq, lastOffset, offsetDelta, timestamp));
        this.lastTimestamp = timestamp;
    }
Returns a new instance with the provided parameters (when present) and the values from the current instance
otherwise.
storage/src/main/java/org/apache/kafka/storage/internals/log/ProducerStateEntry.java