code: public String generateName(String name) {
      checkName(name);
      names.add(name);
      int count = names.count(name);
      if (count == 1) {
        return name;
      }
      return name + collisionSeparator + (count - 1);
    }
docs: Returns a name based on the supplied one that is guaranteed to be unique among the names that
  have been returned by this method.