synchronized void removeWarningsInsideErrors(@NotNull List<? extends PsiFile> injectedFragments,
                                               @NotNull Document hostDocument,
                                               @NotNull HighlightingSession highlightingSession) {
    HighlightersRecycler recycler = new HighlightersRecycler();
    for (PsiFile psiFile: ContainerUtil.append(injectedFragments, highlightingSession.getPsiFile())) {
      Map<Object, ToolHighlights> map = getData(psiFile, hostDocument);
      if (map.isEmpty()) {
        continue;
      }
      List<? extends HighlightInfo> sorted = map.entrySet().stream()
        .filter(e -> isInspectionToolId(e.getKey())) // inspections only
        .flatMap(e -> e.getValue().elementHighlights.values().stream())
        .flatMap(l->l.stream())
        .sorted(UpdateHighlightersUtil.BY_ACTUAL_START_OFFSET_NO_DUPS)
        .toList();
      SweepProcessor.Generator<HighlightInfo> generator = processor -> ContainerUtil.process(sorted, processor);
      SeverityRegistrar severityRegistrar = SeverityRegistrar.getSeverityRegistrar(highlightingSession.getProject());
      SweepProcessor.sweep(generator, (__, info, atStart, overlappingIntervals) -> {
        if (!atStart) {
          return true;
        }
        if (info.isFileLevelAnnotation()) {
          return true;
        }

        // TODO uncomment if duplicates need to be removed automatically
        // Currently they are not, to manifest incorrectly written inspections/annotators earlier
        if (UpdateHighlightersUtil.isWarningCoveredByError(info, severityRegistrar, overlappingIntervals)/* || overlappingIntervals.contains(info)*/) {
          RangeHighlighterEx highlighter = info.getHighlighter();
          if (highlighter != null) {
            recycler.recycleHighlighter(highlighter);

            ToolHighlights elementHighlights = map.get(info.toolId);
            for (Map.Entry<PsiElement, List<? extends HighlightInfo>> elementEntry : elementHighlights.elementHighlights.entrySet()) {
              List<? extends HighlightInfo> infos = elementEntry.getValue();
              int i = infos.indexOf(info);
              if (i != -1) {
                List<HighlightInfo> listMinusInfo = ContainerUtil.concat(infos.subList(0, i), infos.subList(i + 1, infos.size()));
                if (listMinusInfo.isEmpty()) {
                  elementHighlights.elementHighlights.remove(elementEntry.getKey());
                }
                else {
                  elementEntry.setValue(listMinusInfo);
                }
                break;
              }
            }
          }
        }
        return true;
      });
    }
    Collection<? extends RangeHighlighter> warns = recycler.forAllInGarbageBin();
    if (LOG.isDebugEnabled() && !warns.isEmpty()) {
      LOG.debug("removeWarningsInsideErrors: found " + warns);
    }
    UpdateHighlightersUtil.incinerateObsoleteHighlighters(recycler, highlightingSession);
  }
synchronized void removeWarningsInsideErrors(@NotNull List<? extends PsiFile> injectedFragments,
                                               @NotNull Document hostDocument,
                                               @NotNull HighlightingSession highlightingSession)