code: public void reserve(String name) {
      checkName(name);
      // if this is new
      if (reserved.add(name)) {
        // add it to names, so that generateName will still work for reserved names (they will just
        // get suffixes).
        if (!names.add(name)) {
          names.remove(name);
          throw new IllegalArgumentException("newly reserved name: " + name + " was already used!");
        }
      }
    }
docs: Reserves the name, useful for keywords.