@Nullable
  private static HighlightInfo.Builder checkWriteToFinalInsideLambda(@NotNull PsiVariable variable, @NotNull PsiJavaCodeReferenceElement context) {
    PsiLambdaExpression lambdaExpression = PsiTreeUtil.getParentOfType(context, PsiLambdaExpression.class);
    if (lambdaExpression != null && !PsiTreeUtil.isAncestor(lambdaExpression, variable, true)) {
      PsiElement parent = variable.getParent();
      if (parent instanceof PsiParameterList && parent.getParent() == lambdaExpression) {
        return null;
      }
      PsiSwitchLabelStatementBase label =
        PsiTreeUtil.getParentOfType(context, PsiSwitchLabelStatementBase.class, true, PsiLambdaExpression.class);
      if (label != null && PsiTreeUtil.isAncestor(label.getGuardExpression(), context, false)) {
        return null;
      }
      if (!isEffectivelyFinal(variable, lambdaExpression, context)) {
        String text = JavaErrorBundle.message("lambda.variable.must.be.final");
        HighlightInfo.Builder builder = HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(context).descriptionAndTooltip(text);
        IntentionAction action1 = getQuickFixFactory().createVariableAccessFromInnerClassFix(variable, lambdaExpression);
        builder.registerFix(action1, null, null, null, null);
        IntentionAction action = getQuickFixFactory().createMakeVariableEffectivelyFinalFix(variable);
        if (action != null) {
          builder.registerFix(action, null, null, null, null);
        }
        ErrorFixExtensionPoint.registerFixes(builder, context, "lambda.variable.must.be.final");
        return builder;
      }
    }
    return null;
  }
@Nullable
  private static HighlightInfo.Builder checkWriteToFinalInsideLambda(@NotNull PsiVariable variable, @NotNull PsiJavaCodeReferenceElement context)