boolean (PsiMethodCallExpression methodCallExpression) { String name = methodCallExpression.getMethodExpression().getReferenceName(); if (!"filter".equals(name) && !"anyMatch".equals(name)) return false; final PsiExpressionList argumentList = methodCallExpression.getArgumentList(); final PsiExpression[] expressions = argumentList.getExpressions(); if (expressions.length != 1) return false; if (!StreamRefactoringUtil.isRefactoringCandidate(PsiUtil.skipParenthesizedExprDown(expressions[0]), true)) { return false; } final PsiMethod method = methodCallExpression.resolveMethod(); if (method == null) return false; final PsiClass containingClass = method.getContainingClass(); final PsiParameter[] parameters = method.getParameterList().getParameters(); return parameters.length == 1 && InheritanceUtil.isInheritor(containingClass, false, CommonClassNames.JAVA_UTIL_STREAM_BASE_STREAM); }