private boolean hasMemberSubscriptionChanged(
        String groupId,
        ConsumerGroupMember member,
        ConsumerGroupMember updatedMember,
        List<CoordinatorRecord> records
    ) {
        String memberId = updatedMember.memberId();
        if (!updatedMember.equals(member)) {
            records.add(newMemberSubscriptionRecord(groupId, updatedMember));

            if (!updatedMember.subscribedTopicNames().equals(member.subscribedTopicNames())) {
                log.info("[GroupId {}] Member {} updated its subscribed topics to: {}.",
                    groupId, memberId, updatedMember.subscribedTopicNames());
                return true;
            }

            if (!updatedMember.subscribedTopicRegex().equals(member.subscribedTopicRegex())) {
                log.info("[GroupId {}] Member {} updated its subscribed regex to: {}.",
                    groupId, memberId, updatedMember.subscribedTopicRegex());
                return true;
            }
        }
        return false;
    }
Creates the member subscription record if the updatedMember is different from
the old member. Returns true if the subscribedTopicNames/subscribedTopicRegex
has changed.

@param groupId       The group id.
@param member        The old member.
@param updatedMember The updated member.
@param records       The list to accumulate any new records.
@return A boolean indicating whether the updatedMember has a different
        subscribedTopicNames/subscribedTopicRegex from the old member.
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java