code: public function add($key, $object)
      {
          if ($this->repository->containsKey($key))
              throw new ReferenceExistsException();
          $this->repository->set($key, $object);
      }
docs: Add a reference identified by key
  
  @param $key
  @param $object
  @return $this
  @throws ReferenceExistsException if reference already exists identified by key