PsiMethodCallExpression (PsiExpression arg) { final PsiLambdaExpression lambda = tryCast(skipParenthesizedExprDown(arg), PsiLambdaExpression.class); if (lambda == null) return null; final PsiParameter[] parameters = lambda.getParameterList().getParameters(); if (parameters.length != 1) return null; final PsiParameter parameter = parameters[0]; final PsiElement body = LambdaUtil.extractSingleExpressionFromBody(lambda.getBody()); final List<PsiReferenceExpression> references = VariableAccessUtils.getVariableReferences(parameter, body); if (references.size() != 1) return null; final PsiMethodCallExpression call = ExpressionUtils.getCallForQualifier(references.get(0)); if (call == null || !call.getArgumentList().isEmpty()) return null; return call; }