String (LibraryTable.ModifiableModel table, final String baseName) { String candidateName = baseName; int idx = 1; while (libraryAlreadyExists(table, candidateName)) { candidateName = baseName + (idx++); } return candidateName; }