private static boolean isAssignmentContext(PsiExpression expr, PsiElement context) {
    return PsiUtil.isCondition(expr, context) ||
           context instanceof PsiReturnStatement ||
           context instanceof PsiAssignmentExpression && ((PsiAssignmentExpression)context).getOperationTokenType() == JavaTokenType.EQ ||
           context instanceof PsiVariable && !isVarContext((PsiVariable)context) ||
           context instanceof PsiLambdaExpression;
  }
private static boolean isAssignmentContext(PsiExpression expr, PsiElement context)