private function resolve(RouteInterface $route, RoutableInterface $entity)
    {
        $persistedRoute = $this->routeRepository->findByPath($route->getPath(), $route->getLocale());

        if (!$persistedRoute) {
            return $route;
        }

        if ($persistedRoute->getEntityClass() === $route->getEntityClass()
            && $persistedRoute->getEntityId() === $route->getEntityId()
        ) {
            return $persistedRoute;
        }

        throw new RouteIsNotUniqueException($route, $entity);
    }