def recognize(env, options = {}, params = nil)
      require 'hanami/routing/recognized_route'

      env          = env_for(env, options, params)
      responses, _ = *@router.recognize(env)

      Routing::RecognizedRoute.new(
        responses.nil? ? responses : responses.first,
        env, @router)
    end
def recognize(env, options = {}, params = nil)
      require 'hanami/routing/recognized_route'

      env          = env_for(env, options, params)
      responses, _ = *@router.recognize(env)

      Routing::RecognizedRoute.new(
        responses.nil? ? responses : responses.first,
        env, @router)
    end
Recognize the given env, path, or name and return a route for testing
 inspection.

 If the route cannot be recognized, it still returns an object for testing
 inspection.

 @param env [Hash, String, Symbol] Rack env, path or route name
 @param options [Hash] a set of options for Rack env or route params
 @param params [Hash] a set of params

 @return [Hanami::Routing::RecognizedRoute] the recognized route

 @since 0.5.0

 @see Hanami::Router#env_for
 @see Hanami::Routing::RecognizedRoute

 @example Successful Path Recognition
   require 'hanami/router'

   router = Hanami::Router.new do
     get '/books/:id', to: 'books#show', as: :book
   end

   route = router.recognize('/books/23')
   route.verb      # => "GET" (default)
   route.routable? # => true
   route.params    # => {:id=>"23"}

 @example Successful Rack Env Recognition
   require 'hanami/router'

   router = Hanami::Router.new do
     get '/books/:id', to: 'books#show', as: :book
   end

   route = router.recognize(Rack::MockRequest.env_for('/books/23'))
   route.verb      # => "GET" (default)
   route.routable? # => true
   route.params    # => {:id=>"23"}

 @example Successful Named Route Recognition
   require 'hanami/router'

   router = Hanami::Router.new do
     get '/books/:id', to: 'books#show', as: :book
   end

   route = router.recognize(:book, id: 23)
   route.verb      # => "GET" (default)
   route.routable? # => true
   route.params    # => {:id=>"23"}

 @example Failing Recognition For Unknown Path
   require 'hanami/router'

   router = Hanami::Router.new do
     get '/books/:id', to: 'books#show', as: :book
   end

   route = router.recognize('/books')
   route.verb      # => "GET" (default)
   route.routable? # => false

 @example Failing Recognition For Path With Wrong HTTP Verb
   require 'hanami/router'

   router = Hanami::Router.new do
     get '/books/:id', to: 'books#show', as: :book
   end

   route = router.recognize('/books/23', method: :post)
   route.verb      # => "POST"
   route.routable? # => false

 @example Failing Recognition For Rack Env With Wrong HTTP Verb
   require 'hanami/router'

   router = Hanami::Router.new do
     get '/books/:id', to: 'books#show', as: :book
   end

   route = router.recognize(Rack::MockRequest.env_for('/books/23', method: :post))
   route.verb      # => "POST"
   route.routable? # => false

 @example Failing Recognition Named Route With Wrong Params
   require 'hanami/router'

   router = Hanami::Router.new do
     get '/books/:id', to: 'books#show', as: :book
   end

   route = router.recognize(:book)
   route.verb      # => "GET" (default)
   route.routable? # => false

 @example Failing Recognition Named Route With Wrong HTTP Verb
   require 'hanami/router'

   router = Hanami::Router.new do
     get '/books/:id', to: 'books#show', as: :book
   end

   route = router.recognize(:book, {method: :post}, {id: 1})
   route.verb      # => "POST"
   route.routable? # => false
   route.params    # => {:id=>"1"}