private static @Nullable Language findJavaOrLikeLanguage(final @NotNull PsiFile file) {
    final Set<Language> languages = file.getViewProvider().getLanguages();
    if (languages.contains(JavaLanguage.INSTANCE)) return JavaLanguage.INSTANCE;
    for (final Language language : languages) {
      if (language.isKindOf(JavaLanguage.INSTANCE)) return language;
    }
    return null;
  }
private static @Nullable Language findJavaOrLikeLanguage(final @NotNull PsiFile file)