public function generateUniqueRoute(RouteInterface $route, $withSlash = false)
    {
        $originalRoutePattern = $this->generateRouteFromText($route->getRoutePattern(), $withSlash);

        if ($originalRoutePattern) {
            $key = 0;
            $routePattern = $this->normalizeRoute($originalRoutePattern);

            while ($this->hasRoute($routePattern, $route->getName())) {
                $key++;
                $routePattern = $originalRoutePattern . '-' . $key;
            }

            $route->setRoutePattern($routePattern);

            return $route;
        }

        return null;
    }