private static void putInfosForVisitedPsi(@NotNull Map<Object, ToolHighlights> data,
                                            @NotNull @NonNls Object toolId,
                                            @NotNull PsiElement visitedPsi,
                                            @NotNull List<? extends HighlightInfo> newInfos,
                                            @Nullable ToolHighlights toolHighlights) {
    if (newInfos.isEmpty() || toolHighlights == null) {
      boolean toolEmpty;
      if (toolHighlights == null) {
        toolEmpty = true;
      }
      else {
        toolHighlights.elementHighlights.remove(visitedPsi);
        toolEmpty = toolHighlights.elementHighlights.isEmpty();
      }
      if (toolEmpty) {
        data.remove(toolId);
      }
    }
    else {
      toolHighlights.elementHighlights.put(visitedPsi, newInfos);
    }
  }
private static void putInfosForVisitedPsi(@NotNull Map<Object, ToolHighlights> data,
                                            @NotNull @NonNls Object toolId,
                                            @NotNull PsiElement visitedPsi,
                                            @NotNull List<? extends HighlightInfo> newInfos,
                                            @Nullable ToolHighlights toolHighlights)