private boolean validateOnlineDowngrade(ConsumerGroup consumerGroup, String memberId) {
        if (!consumerGroup.allMembersUseClassicProtocolExcept(memberId)) {
            return false;
        } else if (consumerGroup.numMembers() <= 1) {
            log.debug("Skip downgrading the consumer group {} to classic group because it's empty.",
                consumerGroup.groupId());
            return false;
        } else if (!consumerGroupMigrationPolicy.isDowngradeEnabled()) {
            log.info("Cannot downgrade consumer group {} to classic group because the online downgrade is disabled.",
                consumerGroup.groupId());
            return false;
        } else if (consumerGroup.numMembers() - 1 > classicGroupMaxSize) {
            log.info("Cannot downgrade consumer group {} to classic group because its group size is greater than classic group max size.",
                consumerGroup.groupId());
            return false;
        }
        return true;
    }
Validates the online downgrade if a consumer member is fenced from the consumer group.

@param consumerGroup The ConsumerGroup.
@param memberId      The fenced member id.
@return A boolean indicating whether it's valid to online downgrade the consumer group.
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java