public function addGroup($groupIdent, $group)
    {
        if (!is_string($groupIdent)) {
            throw new InvalidArgumentException(
                'Group identifier must be a string'
            );
        }

        if ($group instanceof SecondaryMenuGroupInterface) {
            $group->setSecondaryMenu($this);
            $group->setIdent($groupIdent);

            $this->groups[] = $group;
        } elseif (is_array($group)) {
            if (isset($group['ident'])) {
                $groupIdent = $group['ident'];
            } else {
                $group['ident'] = $groupIdent;
            }

            $displayOptions = $this->displayOptions();
            if (isset($group['display_options'])) {
                $displayOptions = array_merge($displayOptions, $group['display_options']);
            }

            $group['collapsed'] = $displayOptions['collapsed'];
            $group['parented']  = $displayOptions['parented'];

            if (!isset($group['display_type'])) {
                $group['display_type'] = $this->displayType();
            }

            $collapsible = ($group['display_type'] === 'collapsible');

            if ($collapsible) {
                $group['group_id'] = uniqid('collapsible_');
            }

            $g = $this->secondaryMenu()->create($this->defaultGroupType());
            $g->setSecondaryMenu($this);
            $g->setData($group);

            $group = $g;
        } elseif ($group === false || $group === null) {
            return $this;
        } else {
            throw new InvalidArgumentException(sprintf(
                'Group must be an instance of %s or an array of form group options, received %s',
                'SecondaryMenuGroupInterface',
                (is_object($group) ? get_class($group) : gettype($group))
            ));
        }

        if ($g->isAuthorized() === false) {
            return $this;
        }

        $this->groups[] = $g;

        return $this;
    }