private static void renameModules(Project project, List<? extends Pair<SmartPsiElementPointer<PsiJavaModule>, String>> suggestions) {
    MyAutomaticRenamer renamer = new MyAutomaticRenamer();
    for (Pair<SmartPsiElementPointer<PsiJavaModule>, String> rename : suggestions) {
      PsiJavaModule javaModule = rename.first.getElement();
      if (javaModule != null) {
        renamer.addElement(javaModule, rename.second);
      }
    }

    if (renamer.hasAnythingToRename()) {
      AutomaticRenamingDialog dialog = new AutomaticRenamingDialog(project, renamer);
      dialog.showOptionsPanel();

      if (dialog.showAndGet()) {
        RenameProcessor processor = null;

        for (Map.Entry<PsiNamedElement, String> entry : renamer.getRenames().entrySet()) {
          String newName = entry.getValue();
          if (newName != null) {
            if (processor == null) {
              processor = new RenameProcessor(project, entry.getKey(), newName, dialog.isSearchInComments(), dialog.isSearchTextOccurrences());
            }
            else {
              processor.addElement(entry.getKey(), newName);
            }
          }
        }

        if (processor != null) {
          processor.run();
        }
      }
    }
  }
private static void renameModules(Project project, List<? extends Pair<SmartPsiElementPointer<PsiJavaModule>, String>> suggestions)