public function prepare()
    {
        if ($this->prepared) {
            return;
        }
        usort($this->groups, function(MenuGroup $a, MenuGroup $b) {
            if ($a->getPosition() == $b->getPosition()) {
                return 0;
            }
            return $a->getPosition() > $b->getPosition() ? 1 : -1;
        });
        foreach ($this->groups as $group) {
            $group->prepare();
        }
        $this->prepared = true;
    }