@Contract("null -> false")
  public static boolean canUseAsNonFinal(PsiLocalVariable var) {
    if (var == null) return false;
    PsiElement block = PsiUtil.getVariableCodeBlock(var, null);
    return block != null &&
           getVariableReferences(var).stream()
             .map(ref -> PsiTreeUtil.getParentOfType(ref, PsiClass.class, PsiLambdaExpression.class))
             .allMatch(context -> context == null || PsiTreeUtil.isAncestor(context, block, false));
  }
@Contract("null -> false")
  public static boolean canUseAsNonFinal(PsiLocalVariable var)