public function setMaxChoices($maxChoices)
    {
        if (is_int($maxChoices) === true && $maxChoices > 0 || $maxChoices === -1) {

            if ($this->hasMinChoices() === true && $maxChoices > count($this->getSimpleChoices())) {
                $msg = "The 'maxChoices' argument cannot exceed the number of available choices.";
                throw new InvalidArgumentException($msg);
            }

            $this->maxChoices = $maxChoices;
        } else {
            $msg = "The 'maxChoices' argument must be a strictly positive (> 0) integer or -1, '" . gettype($maxChoices) . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }