private @Nullable LanguageLevel getLanguageLevel(@NotNull IdeaProject ideaProject) {
    List<Pair<IdeaModule, ExternalProject>> externalModules = getExternalModules(ideaProject);
    LanguageLevel languageLevel = externalModules.stream()
      .map(it -> getLanguageLevel(it.first, it.second))
      .filter(it -> it != null)
      .min(Comparator.naturalOrder())
      .orElse(null);
    if (languageLevel != null) return languageLevel;
    boolean isPreview = ContainerUtil.and(externalModules, it -> isPreview(it.second));
    IdeaJavaLanguageSettings javaLanguageSettings = ideaProject.getJavaLanguageSettings();
    return getLanguageLevel(javaLanguageSettings, isPreview);
  }
private @Nullable LanguageLevel getLanguageLevel(@NotNull IdeaProject ideaProject)