PsiMethodCallPattern (final ElementPattern<? extends PsiExpression>... arguments) { return with(new PatternCondition<PsiMethodCallExpression>("withArguments") { @Override public boolean accepts(@NotNull PsiMethodCallExpression callExpression, ProcessingContext context) { final PsiExpression[] actualArguments = callExpression.getArgumentList().getExpressions(); if (arguments.length != actualArguments.length) { return false; } for (int i = 0; i < actualArguments.length; i++) { if (!arguments[i].accepts(actualArguments[i], context)) { return false; } } return true; } }); }