private Optional<Integer> maybeLeaderEpoch(final int leaderEpoch) {
        return leaderEpoch == RecordBatch.NO_PARTITION_LEADER_EPOCH ? Optional.empty() : Optional.of(leaderEpoch);
    }
Parse the record entry, deserializing the key / value fields if necessary
clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareCompletedFetch.java