<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def addProteinGroup(self, groupRepresentative):
 """Adds a new protein group and returns the groupId. The groupId is defined using an internal counter, which is incremented every time a protein group is added. The groupRepresentative is added as a leading protein. :param groupRepresentative: the protein group representing protein :returns: the protein groups groupId """

        groupId = self._getNextGroupId()
        self.groups[groupId] = ProteinGroup(groupId, groupRepresentative)
        self.addLeadingToGroups(groupRepresentative, groupId)
        return groupId