public function getRouter()
    {
        if (!isset($this->router)) {
            $container = clone $this->getContainer();
            $container->delegate(new ReflectionContainer);
            $this->router = (new RouteCollection($container));
        }

        /** @var RouteCollection $router */
        $router = $this->validateContract($this->router, RouteCollection::class);
        return $router;
    }