static HighlightInfo.Builder checkVariableMustBeFinal(@NotNull PsiVariable variable,
                                                @NotNull PsiJavaCodeReferenceElement context,
                                                @NotNull LanguageLevel languageLevel) {
    if (variable.hasModifierProperty(PsiModifier.FINAL)) return null;
    PsiElement scope = getElementVariableReferencedFrom(variable, context);
    if (scope instanceof PsiClass) {
      if (variable instanceof PsiParameter) {
        PsiElement parent = variable.getParent();
        if (parent instanceof PsiParameterList && parent.getParent() instanceof PsiLambdaExpression &&
            !VariableAccessUtils.variableIsAssigned(variable, ((PsiParameter)variable).getDeclarationScope())) {
          return null;
        }
      }
      boolean isToBeEffectivelyFinal = JavaFeature.EFFECTIVELY_FINAL.isSufficient(languageLevel);
      if (isToBeEffectivelyFinal && isEffectivelyFinal(variable, scope, context)) {
        return null;
      }
      String description = JavaErrorBundle
        .message(isToBeEffectivelyFinal ? "variable.must.be.final.or.effectively.final" : "variable.must.be.final", context.getText());

      HighlightInfo.Builder highlightInfo =
        HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(context).descriptionAndTooltip(description);
      IntentionAction action = getQuickFixFactory().createVariableAccessFromInnerClassFix(variable, scope);
      highlightInfo.registerFix(action, null, null, null, null);
      return highlightInfo;
    }
    HighlightInfo.Builder finalInsideLambdaInfo = checkWriteToFinalInsideLambda(variable, context);
    if (finalInsideLambdaInfo != null) {
      return finalInsideLambdaInfo;
    }
    return checkFinalUsageInsideGuardedPattern(variable, context);
  }
static HighlightInfo.Builder checkVariableMustBeFinal(@NotNull PsiVariable variable,
                                                @NotNull PsiJavaCodeReferenceElement context,
                                                @NotNull LanguageLevel languageLevel)