public static void replaceLibraryEntryByAdded(@NotNull ModifiableRootModel model, @NotNull LibraryOrderEntry entry) {
    int i = ArrayUtil.indexOf(model.getOrderEntries(), entry);
    if (i == -1) return;

    replaceLibraryByAdded(model, i);
  }
public static void replaceLibraryEntryByAdded(@NotNull ModifiableRootModel model, @NotNull LibraryOrderEntry entry)