List<TopicIdPartition> cachedTopicIdPartitionsInShareSession(String groupId, Uuid memberId) {
        ShareSessionKey key = shareSessionKey(groupId, memberId);
        ShareSession shareSession = cache.get(key);
        if (shareSession == null) {
            return Collections.emptyList();
        }
        List<TopicIdPartition> cachedTopicIdPartitions = new ArrayList<>();
        shareSession.partitionMap().forEach(cachedSharePartition -> cachedTopicIdPartitions.add(
            new TopicIdPartition(cachedSharePartition.topicId(), new TopicPartition(cachedSharePartition.topic(), cachedSharePartition.partition()
            ))));
        return cachedTopicIdPartitions;
    }
The cachedTopicIdPartitionsInShareSession method is used to get the cached topic-partitions in the share session.

@param groupId The group id in the share fetch request.
@param memberId The member id in the share fetch request.

@return The list of cached topic-partitions in the share session if present, otherwise an empty list.
core/src/main/java/kafka/server/share/SharePartitionManager.java