public boolean areMandatoryProtocolTypeAndNamePresent() {
        if (version() >= 5)
            return data.protocolType() != null && data.protocolName() != null;
        else
            return true;
    }
ProtocolType and ProtocolName are mandatory since version 5. This method verifies that
they are defined for version 5 or higher, or returns true otherwise for older versions.
clients/src/main/java/org/apache/kafka/common/requests/SyncGroupRequest.java