private static void maybeUpdateSubscribedTopicNames(
        Map<String, Integer> subscribedTopicCount,
        ModernGroupMember oldMember,
        ModernGroupMember newMember
    ) {
        if (oldMember != null) {
            oldMember.subscribedTopicNames().forEach(topicName ->
                subscribedTopicCount.compute(topicName, Utils::decValue)
            );
        }

        if (newMember != null) {
            newMember.subscribedTopicNames().forEach(topicName ->
                subscribedTopicCount.compute(topicName, Utils::incValue)
            );
        }
    }
Updates the subscription count.

@param subscribedTopicCount  The map to update.
@param oldMember             The old member.
@param newMember             The new member.
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/modern/ModernGroup.java