public static function paginateChoices(AjaxChoiceLoaderInterface $choiceLoader, array $choices)
    {
        list($startTo, $endTo) = static::getRangeValues($choiceLoader);

        // group
        if (\is_array(current($choices))) {
            return static::paginateGroupChoices($choices, $startTo, $endTo);
        }

        return static::paginateSimpleChoices($choices, $startTo, $endTo);
    }