public boolean isLibraryChosen(LibraryDescriptor lib) {
    Set<LibraryDescriptor> available = myLibrariesSet;
    if (available == null) {
      available = new HashSet<>(myLibraries);
      myLibrariesSet = available;
    }
    return available.contains(lib);
  }
public boolean isLibraryChosen(LibraryDescriptor lib)