public function selectHandler($handler)
    {
        if (!is_callable($handler)) {
            Assert::string($handler, 'The selected handler must be a callable or a string. Got: %s');

            if (!isset($this->handlers[$handler])) {
                throw new InvalidArgumentException(sprintf(
                    'The handler "%s" does not exist.',
                    $handler
                ));
            }
        }

        $this->selectedHandler = $handler;
    }