public static boolean isAvailable(@NotNull JavaFeature feature, @NotNull PsiElement element) {
    if (!feature.isSufficient(getLanguageLevel(element))) return false;
    if (!feature.canBeCustomized()) return true;
    PsiFile file = element.getContainingFile();
    if (file == null) return true;
    for (LanguageFeatureProvider extension : LanguageFeatureProvider.EXTENSION_POINT_NAME.getExtensionList()) {
      ThreeState threeState = extension.isFeatureSupported(feature, file);
      if (threeState != ThreeState.UNSURE)
        return threeState.toBoolean();
    }
    return true;
  }
public static boolean isAvailable(@NotNull JavaFeature feature, @NotNull PsiElement element)