private function createResponse(ResponseInterface $adapterResponse = null)
    {
        $response = new Response();

        if ($adapterResponse !== null) {
            $response->setCode($adapterResponse->getStatusCode());
            $response->setHeaders(new ParameterBag($adapterResponse->getHeaders()));
            $response->setBody((string) $adapterResponse->getBody());
        }

        return $response;
    }