public static Optional<FetchResponseData.EpochEndOffset> divergingEpoch(FetchResponseData.PartitionData partitionResponse) {
        return partitionResponse.divergingEpoch().epoch() < 0 ? Optional.empty()
                : Optional.of(partitionResponse.divergingEpoch());
    }
Convenience method to find the size of a response.

@param version       The version of the response to use.
@param partIterator  The partition iterator.
@return              The response size in bytes.
clients/src/main/java/org/apache/kafka/common/requests/FetchResponse.java