public function setStyle($style, Document $document = NULL) {
    $class = 'ChapterThree\AppleNewsAPI\Document\Styles\ComponentStyle';
    if (is_string($style)) {
      // Check that style exists.
      if ($document &&
          empty($document->getComponentStyles()[$style])
      ) {
        $this->triggerError("No component style \"${style}\" found.");
        return $this;
      }
    }
    elseif (!$style instanceof $class) {
      $this->triggerError("Style not of class ${class}.");
      return $this;
    }
    $this->style = $style;
    return $this;
  }