private function findRoutes($history, $entityClass, $entityId, $locale)
    {
        /** @var RouteRepositoryInterface $routeRespository */
        $routeRespository = $this->get('sulu.repository.route');

        if ($history) {
            return $routeRespository->findHistoryByEntity($entityClass, $entityId, $locale);
        }

        return [$routeRespository->findByEntity($entityClass, $entityId, $locale)];
    }