code: public function set($key, $value)
      {
          if (!$value instanceof Stat) {
              throw new InvalidArgumentException('Element is not a stat object.');
          }
  
          return parent::set($key, $value);
      }
docs: {@inheritDoc}