public function negotiate($content, MediaTypeList $mediaTypeList)
    {
        $contentType = $mediaTypeList->getBestMatch(array_keys($this->supportedMediaTypes));
        if (!$contentType) {
            throw new Exception('A suitable Content-Type could not be found.');
        }

        $result = new NegotiatedResult();
        $result->contentType = $contentType;
        $result->content = $this->encode($content, $contentType);

        return $result;
    }