PsiMethodCallPattern (final ElementPattern<? extends PsiExpression> qualifier) { return with(new PatternCondition<PsiMethodCallExpression>("withQualifier") { @Override public boolean accepts(@NotNull PsiMethodCallExpression psiMethodCallExpression, ProcessingContext context) { return qualifier.accepts(psiMethodCallExpression.getMethodExpression().getQualifierExpression(), context); } }); }