private boolean ownsRevokedPartitions(
        Map<Uuid, Set<Integer>> assignment
    ) {
        if (ownedTopicPartitions == null) return true;

        for (ConsumerGroupHeartbeatRequestData.TopicPartitions topicPartitions : ownedTopicPartitions) {
            Set<Integer> partitionsPendingRevocation =
                assignment.getOrDefault(topicPartitions.topicId(), Collections.emptySet());

            for (Integer partitionId : topicPartitions.partitions()) {
                if (partitionsPendingRevocation.contains(partitionId)) {
                    return true;
                }
            }
        }

        return false;
    }
Decides whether the current ownedTopicPartitions contains any partition that is pending revocation.

@param assignment The assignment that has the partitions pending revocation.
@return A boolean based on the condition mentioned above.
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/modern/consumer/CurrentAssignmentBuilder.java