private static int findLibraryOrderEntry(OrderEntry @NotNull [] entries, @NotNull Library library) {
    for (int i = 0; i < entries.length; i++) {
      OrderEntry entry = entries[i];
      if (entry instanceof LibraryOrderEntry && library.equals(((LibraryOrderEntry)entry).getLibrary())) {
        return i;
      }
    }
    return -1;
  }
private static int findLibraryOrderEntry(OrderEntry @NotNull [] entries, @NotNull Library library)