private String getNewName(String baseName) {

		int index = 2;
		if (nameIndexer.get(baseName) < 0) {
			if (listing.getModule(treeName, baseName) == null &&
				listing.getFragment(treeName, baseName) == null) {
				return baseName;
			}
		}

		boolean done = false;
		while (!done) {
			String name = baseName + " (" + index + ")";
			if (nameIndexer.get(name) < 0) {
				if (listing.getModule(treeName, name) == null &&
					listing.getFragment(treeName, name) == null) {
					return name;
				}
			}
			++index;
		}
		return null; // should never get here
	}
Generate a unique name to be used as the default when
a Module or Fragment is created.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/programtree/ProgramDnDTree.java