@Override
  public void apply() throws ConfigurationException {
    ApplicationManager.getApplication().runWriteAction(() -> {
      ModifiableRootModel model = ModuleRootManager.getInstance(myModule).getModifiableModel();
      List<ModuleOrderEntry> entries = new ArrayList<>();
      for (OrderEntry entry : model.getOrderEntries()) {
        if (entry instanceof ModuleOrderEntry) {
          entries.add((ModuleOrderEntry) entry);
        }
      }
      for (ModuleOrderEntry entry : entries) {
        model.removeOrderEntry(entry);
      }
      for (Module module : collectDependencies()) {
        model.addModuleOrderEntry(module);
      }
      model.commit();
    });
  }
@Override
  public void apply()