public QuickFixAction @NotNull [] getPartialQuickFixes(@NotNull InspectionToolWrapper toolWrapper, @NotNull InspectionTree tree,
                                                         CommonProblemDescriptor @NotNull [] selectedDescriptors) {
    GlobalInspectionContextImpl context = tree.getContext();
    InspectionToolPresentation presentation = context.getPresentation(toolWrapper);
    Map<String, FixAndOccurrences> result = new LinkedHashMap<>();
    for (CommonProblemDescriptor d : selectedDescriptors) {
      QuickFix<?>[] fixes = d.getFixes();
      if (fixes == null) continue;
      for (QuickFix<?> fix : fixes) {
        String familyName = fix.getFamilyName();
        FixAndOccurrences fixAndOccurrences = result.get(familyName);
        if (fixAndOccurrences == null) {
          LocalQuickFixWrapper localQuickFixWrapper = new LocalQuickFixWrapper(fix, presentation.getToolWrapper());
          try {
            localQuickFixWrapper.setText(StringUtil.escapeMnemonics(fix.getFamilyName()));
          }
          catch (AbstractMethodError e) {
            //for plugin compatibility
            localQuickFixWrapper.setText(LangBundle.message("action.name.not.available.text"));
          }
          fixAndOccurrences = new FixAndOccurrences(localQuickFixWrapper);
          result.put(familyName, fixAndOccurrences);
        } else {
          final QuickFixAction quickFixAction = fixAndOccurrences.fix;
          if (quickFixAction instanceof LocalQuickFixesWrapper) {
            ((LocalQuickFixesWrapper)quickFixAction).addFixAction(fix, presentation.getToolWrapper());
          } else {
            assert quickFixAction instanceof LocalQuickFixWrapper;
            if (fix.getClass() != ((LocalQuickFixWrapper)quickFixAction).getFix().getClass()) {
              fixAndOccurrences.fix = new LocalQuickFixesWrapper(quickFixAction.getText(),
                                                                 List.of(((LocalQuickFixWrapper)quickFixAction).getFix(), fix),
                                                                 presentation.getToolWrapper());
            }
          }
        }
        fixAndOccurrences.occurrences++;
      }
    }

    return result
      .values()
      .stream()
      .filter(fixAndOccurrence -> fixAndOccurrence.occurrences != selectedDescriptors.length)
      .sorted(Comparator.comparingInt((FixAndOccurrences fixAndOccurrence) -> fixAndOccurrence.occurrences).reversed())
      .map(fixAndOccurrence -> {
        QuickFixAction fix = fixAndOccurrence.fix;
        int occurrences = fixAndOccurrence.occurrences;
        if (fix instanceof LocalQuickFixWrapper) {
          ((LocalQuickFixWrapper)fix).setText(LangBundle.message("action.fix.n.problems.text", fix.getText(), occurrences));
        } else if (fix instanceof LocalQuickFixesWrapper) {
          ((LocalQuickFixesWrapper)fix).setText(LangBundle.message("action.fix.n.problems.text", fix.getText(), occurrences));
        }
        return fix;
      })
      .toArray(QuickFixAction[]::new);
  }
public QuickFixAction @NotNull [] getPartialQuickFixes(@NotNull InspectionToolWrapper toolWrapper, @NotNull InspectionTree tree,
                                                         CommonProblemDescriptor @NotNull [] selectedDescriptors)