public function getEndpointForRequest(RequestInterface $request): EndpointInterface
    {
        $requestClass = get_class($request);
        if (!isset($this->endpointsByRequestClass[$requestClass])) {
            throw new UnsupportedRequestException($requestClass);
        }

        return $this->endpointsByRequestClass[$requestClass];
    }