private function doTransformObjectResponse(ObjectResponse $objectResponse)
    {
        $responseData = $objectResponse;

        if ($objectResponse->isActionTransform()) {
            try {
                $responseData = $this->transformerManager->transform(
                    $responseData->getObject(),
                    $objectResponse->getTransformerContext()
                );

                if (!is_object($responseData)) {
                    throw UnexpectedTypeException::create($responseData, 'object');
                }
            } catch (TransformerUnsupportedObjectException $e) {
                throw new \RuntimeException(sprintf(
                    'Can not transform object with class "%s".',
                    get_class($objectResponse)
                ), 0, $e);
            }
        }

        try {
            $responseData = $this->normalizerManager->normalize(
                $responseData instanceof ObjectResponse ? $responseData->getObject() : $responseData,
                $objectResponse->getNormalizerContext()
            );

            if (!is_array($responseData)) {
                throw UnexpectedTypeException::create($responseData, 'array');
            }
        } catch (NormalizerUnsupportedObjectException $e) {
            throw new \RuntimeException(sprintf(
                'Can not normalize object with class "%s".',
                get_class($responseData)
            ), 0, $e);
        }

        if ($objectResponse->isEmptyResponse()) {
            $response = new EmptyResponse($responseData, $objectResponse->getHttpStatusCode());
        } else {
            $response = new Response($responseData, $objectResponse->getHttpStatusCode());
        }

        return $response;
    }