public function getGroup(int $index): Group
    {
        if ($index >= count($this->groups)) {
            throw new \UndefinedOffsetException();
        }
        return $this->groups[$index];
    }