@NotNull
  private static Map<Annotator, Set<Language>> calcSupportedLanguages(@NotNull List<? extends PsiElement> elements) {
    Map<Annotator, Set<Language>> map = CollectionFactory.createCustomHashingStrategyMap(new HashingStrategy<>() {
      @Override
      public int hashCode(Annotator object) {
        return object.getClass().hashCode();
      }

      @Override
      public boolean equals(Annotator o1, Annotator o2) {
        return o1 == null || o2 == null ? o1==o2 : o1.getClass().equals(o2.getClass());
      }
    });
    Set<Language> languages = new HashSet<>();
    for (PsiElement element : elements) {
      Language language = element.getLanguage();
      addDialects(language, languages);
    }
    for (Language language : languages) {
      List<Annotator> templates = LanguageAnnotators.INSTANCE.allForLanguageOrAny(language);
      for (Annotator template : templates) {
        Set<Language> supportedLanguages = map.get(template);
        if (supportedLanguages == null) {
          supportedLanguages = new HashSet<>();
          map.put(cloneTemplate(template), supportedLanguages);
        }
        supportedLanguages.add(language);
      }
    }
    return map;
  }
@NotNull
  private static Map<Annotator, Set<Language>> calcSupportedLanguages(@NotNull List<? extends PsiElement> elements)