private boolean isProtocolInconsistent(
        String protocolTypeOrName,
        String groupProtocolTypeOrName
    ) {
        return protocolTypeOrName != null
            && groupProtocolTypeOrName != null
            && !groupProtocolTypeOrName.equals(protocolTypeOrName);
    }
Checks whether the given protocol type or name in the request is inconsistent with the group's.

@param protocolTypeOrName       The request's protocol type or name.
@param groupProtocolTypeOrName  The group's protoocl type or name.

@return  True if protocol is inconsistent, false otherwise.
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java