Library (@NotNull String name) { final Iterator<Library> libraryIterator = getLibraryIterator(); while (libraryIterator.hasNext()) { Library library = libraryIterator.next(); if (name.equals(library.getName())) return library; } return null; }