code: public function removeGroup(Group $group)
      {
          foreach ($this->groups as $index => $existingGroup) {
              if ($existingGroup === $group) {
                  unset($this->groups[$index]);
  
                  return;
              }
          }
      }
docs: Remove Group
  
  @param \Orkestra\Bundle\ApplicationBundle\Entity\Group $group