protected function _createGroup($key, array $gOptions, array $selected, array $options)
    {
        $label  = (is_int($key)) ? sprintf($this->_translate('Select group %s'), $key) : $key;
        $output = array(
            '<optgroup label="' . $this->_translate($label) . '">'
        );
        foreach ($gOptions as $value => $label) {
            if (Arr::key($value, $options)) {
                continue;
            }

            $classes = implode(' ', array(
                $this->_jbSrt('option'),
                $this->_jbSrt('option-' . Str::slug($label)),
            ));

            $isSelected = $this->_isSelected($value, $selected);

            $output[] = $this->_option($value, $isSelected, $classes, $label);
        }

        $output[] = '</optgroup>';

        return implode(PHP_EOL, $output);
    }