private boolean isLibraryEqualsToSelected(Library library) {
    if (!(library instanceof LibraryEx libraryEx)) {
      return false;
    }

    if (!RepositoryLibraryType.REPOSITORY_LIBRARY_KIND.equals(libraryEx.getKind())) {
      return false;
    }

    LibraryProperties<?> libraryProperties = libraryEx.getProperties();
    if (!(libraryProperties instanceof RepositoryLibraryProperties repositoryLibraryProperties)) {
      return false;
    }
    RepositoryLibraryDescription description = RepositoryLibraryDescription.findDescription(repositoryLibraryProperties);

    if (!description.equals(libraryDescription)) {
      return false;
    }

    return Objects.equals(repositoryLibraryProperties.getVersion(), model.getVersion());
  }
private boolean isLibraryEqualsToSelected(Library library)