Library (@NotNull LibraryTable libraryTable, @NonNls @NotNull String baseName) { String name = baseName; int count = 2; while (libraryTable.getLibraryByName(name) != null) { name = baseName + " (" + count++ + ")"; } return libraryTable.createLibrary(name); }