@NotNull
  private static Map<ProblemDescriptor, HighlightDisplayLevel> runInspectionTool(PsiFile file,
                                                                                 LocalInspectionTool inspectionTool,
                                                                                 HighlightDisplayLevel level) {
    Map<ProblemDescriptor, HighlightDisplayLevel> problemsMap = new java.util.LinkedHashMap<>();
    for (ProblemDescriptor descriptor : runInspectionOnFile(file, inspectionTool)) {
      ProblemHighlightType highlightType = descriptor.getHighlightType();

      HighlightDisplayLevel highlightDisplayLevel;
      if (highlightType == ProblemHighlightType.WEAK_WARNING) {
        highlightDisplayLevel = HighlightDisplayLevel.WEAK_WARNING;
      }
      else if (highlightType == ProblemHighlightType.INFORMATION) {
        highlightDisplayLevel = HighlightDisplayLevel.DO_NOT_SHOW;
      }
      else {
        highlightDisplayLevel = level;
      }
      problemsMap.put(descriptor, highlightDisplayLevel);
    }
    return problemsMap;
  }
@NotNull
  private static Map<ProblemDescriptor, HighlightDisplayLevel> runInspectionTool(PsiFile file,
                                                                                 LocalInspectionTool inspectionTool,
                                                                                 HighlightDisplayLevel level)