public function buildControllerClosure(ContainerInterface $container, Route $route) : \Closure
 {
     $controllerServiceId = $route->controllerServiceId();
     $actionMethodName = $route->actionMethodName();
     $controllerClosure = function (ServerRequestInterface $request, ResponseInterface $response) use($container, $controllerServiceId, $actionMethodName) {
         $controllerObject = $container->get($controllerServiceId);
         $controllerResponse = $controllerObject->{$actionMethodName}($request, $response);
         return $controllerResponse;
     };
     return $controllerClosure;
 }
 function it_can_build_a_controller_closure(ContainerInterface $container, Route $route, SimpleController $simpleController, ServerRequestInterface $request, ResponseInterface $response, JsonResponse $jsonResponse)
 {
     // ARRANGE
     $route->controllerServiceId()->willReturn('controller-service-id');
     $route->actionMethodName()->willReturn('simpleAction');
     $container->get('controller-service-id')->willReturn($simpleController);
     $simpleController->simpleAction($request, $response)->willReturn($jsonResponse);
     // ACT
     $controllerClosure = $this->buildControllerClosure($container, $route);
     $result = $controllerClosure($request, $response);
     // ASSERT
     $controllerClosure->shouldHaveType('closure');
     $result->shouldBe($jsonResponse);
 }