public ShareAcknowledgeRequest.Builder newShareAcknowledgeBuilder(String groupId, FetchConfig fetchConfig) {
        if (nextMetadata.isNewSession()) {
            // A share session cannot be started with a ShareAcknowledge request
            return null;
        }

        Map<TopicIdPartition, List<ShareAcknowledgeRequestData.AcknowledgementBatch>> acknowledgementBatches = new HashMap<>();
        nextAcknowledgements.forEach((partition, acknowledgements) ->
                acknowledgementBatches.put(partition, acknowledgements.getAcknowledgementBatches()
                        .stream().map(AcknowledgementBatch::toShareAcknowledgeRequest)
                        .collect(Collectors.toList())));

        nextAcknowledgements = new LinkedHashMap<>();

        return ShareAcknowledgeRequest.Builder.forConsumer(groupId, nextMetadata, acknowledgementBatches);
    }
All the partitions in the share session.
clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareSessionHandler.java