PsiExpression (PsiMethodCallExpression allMatchCall) { PsiExpression arg = skipParenthesizedExprDown(allMatchCall.getArgumentList().getExpressions()[0]); if (arg instanceof PsiMethodReferenceExpression methodRef) { if (COLLECTION_CONTAINS.methodReferenceMatches(methodRef) && !PsiMethodReferenceUtil.isStaticallyReferenced(methodRef) && !ExpressionUtil.isEffectivelyUnqualified(methodRef)) { return methodRef.getQualifierExpression(); } } else if (arg instanceof PsiLambdaExpression lambda) { PsiParameter[] parameters = lambda.getParameterList().getParameters(); if (parameters.length == 1) { PsiParameter parameter = parameters[0]; PsiExpression expression = skipParenthesizedExprDown(LambdaUtil.extractSingleExpressionFromBody(lambda.getBody())); PsiMethodCallExpression call = tryCast(expression, PsiMethodCallExpression.class); if (COLLECTION_CONTAINS.test(call) && ExpressionUtils.isReferenceTo(call.getArgumentList().getExpressions()[0], parameter) && !ExpressionUtil.isEffectivelyUnqualified(call.getMethodExpression())) { return call.getMethodExpression().getQualifierExpression(); } } } return null; }