public function addMenuItem(MenuItem $menuItem, $position = -1) {
        if (!is_int($position)) {
            throw new InvalidArgumentException('position should be of type int.');
        }

        if ($position < 0) {
            $position = count($this->menuItems);
        }

        $menuItem->setOrder($position);

        Utils::array_insert($this->menuItems, $menuItem, $position);

        return $this;
    }