public function getUrlGenerator()
    {
        if (isset($this->urlGenerator)) {
            return $this->urlGenerator;
        }

        // Check if an URL Generator resolver was set.
        else if (! isset(static::$urlGeneratorResolver)) {
            throw new RuntimeException("URL Generator resolver not set on Paginator.");
        }

        return $this->urlGenerator = call_user_func(static::$urlGeneratorResolver, $this);
    }