public function getRoutes($version = null)
    {
        $routes = $this->adapter->getIterableRoutes($version);

        if (! is_null($version)) {
            $routes = [$version => $routes];
        }

        $collections = [];

        foreach ($routes as $key => $value) {
            $collections[$key] = new RouteCollection($this->container['request']);

            foreach ($value as $route) {
                $route = $this->createRoute($route);

                $collections[$key]->add($route);
            }
        }

        return is_null($version) ? $collections : $collections[$version];
    }