public function add($nodes) {
    if ($nodes instanceof Node) {
      $this->nodes[] = $nodes;
    }
    elseif ($nodes instanceof NodeCollection) {
      $this->nodes = array_merge($this->nodes, $nodes->nodes);
    }
    elseif (is_array($nodes)) {
      $this->nodes = array_merge($this->nodes, $nodes);
    }
    else {
      throw new \InvalidArgumentException();
    }
    $this->nodes = static::sortUnique($this->nodes);
    return $this;
  }