private static void invokeAndUnwrapOptional(CFGBuilder builder,
                                              int argCount,
                                              PsiExpression function) {
    PsiLambdaExpression lambda = ObjectUtils.tryCast(PsiUtil.skipParenthesizedExprDown(function), PsiLambdaExpression.class);
    if (lambda != null) {
      PsiParameter[] parameters = lambda.getParameterList().getParameters();
      PsiExpression lambdaBody = LambdaUtil.extractSingleExpressionFromBody(lambda.getBody());
      if (parameters.length == argCount && lambdaBody != null) {
        StreamEx.ofReversed(parameters).forEach(p -> builder.assignTo(p).pop());
        if (pushOptionalValue(builder, lambdaBody, NullabilityProblemKind.nullableFunctionReturn)) {
          return;
        }
        // Restore stack for common invokeFunction
        StreamEx.of(parameters).map(variable -> PlainDescriptor.createVariableValue(builder.getFactory(), variable)).forEach(builder::push);
      }
    }
    builder
      .evaluateFunction(function)
      .invokeFunction(argCount, function, Nullability.NOT_NULL)
      .pop()
      .pushUnknown();
  }
private static void invokeAndUnwrapOptional(CFGBuilder builder,
                                              int argCount,
                                              PsiExpression function)