public String getUniqueName(String name) {
		if (name == null || usedNames.add(name)) {
			return null;
		}

		String original = name;
		int tryNum = 0;
		while (usedNames.contains(name) || reservedNames.contains(name)) {
			name = String.format("%s_%d", original, ++tryNum);
		}
		usedNames.add(name);
		return name;
	}
Confirms that the specified name is unique, or returns a generated name that is unique.

@param name name to test
@return {@code null} if specified name is already unique (and marks the specified name as
used), or returns a new, unique generated name
Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/dwarf/NameDeduper.java