public function negotiate(Context $context)
 {
     $contentType = $context->getContentType();
     if ($contentType) {
         return $contentType;
     }
     $ext = $context->getUri()->getExtension();
     if ($ext && $this['accepts'][$ext]) {
         return $this['accepts'][$ext];
     }
     $contentType = $context->getRequest()->getContentType();
     if (!$contentType) {
         $accepted = $context->accepts(array_keys($this['accepts']));
         if (isset($accepted)) {
             $contentType = is_string($this['accepts'][$accepted]) ? $this['accepts'][$accepted] : $accepted;
         }
     }
     if ($contentType) {
         return $this->match($contentType);
     }
 }