@ApiStatus.Internal
  @RequiresEdt
  public void removeManagedFiles(List<VirtualFile> selectedFiles,
                                 @Nullable Consumer<MavenProject> removeNotification,
                                 @Nullable Predicate<List<String>> removeConfirmation) {
    List<VirtualFile> removableFiles = new ArrayList<>();
    List<String> filesToUnIgnore = new ArrayList<>();

    List<Module> modulesToRemove = new ArrayList<>();

    for (VirtualFile pomXml : selectedFiles) {
      if (isManagedFile(pomXml)) {
        MavenProject managedProject = findProject(pomXml);
        if (managedProject == null) {
          continue;
        }
        addModuleToRemoveList(modulesToRemove, managedProject);
        getModules(managedProject).forEach(mp -> {
          addModuleToRemoveList(modulesToRemove, mp);
          filesToUnIgnore.add(mp.getFile().getPath());
        });
        removableFiles.add(pomXml);
        filesToUnIgnore.add(pomXml.getPath());
      }
      else {
        if (removeNotification != null) {
          removeNotification.accept(findProject(pomXml));
        }
      }
    }
    if (removeConfirmation != null && !removeConfirmation.test(ContainerUtil.map(modulesToRemove, m -> m.getName()))) {
      return;
    }
    removeModules(ModuleManager.getInstance(getProject()), modulesToRemove);
    removeManagedFiles(removableFiles);
    removeIgnoredFilesPaths(filesToUnIgnore);
  }
@ApiStatus.Internal
  @RequiresEdt
  public void removeManagedFiles(List<VirtualFile> selectedFiles,
                                 @Nullable Consumer<MavenProject> removeNotification,
                                 @Nullable Predicate<List<String>> removeConfirmation)