private static PatternCondition<PsiElementBase> nameCondition(final ElementPattern pattern) { return new PatternConditionPlus<PsiElementBase, String>("_withPsiName", pattern) { @Override public boolean processValues( PsiElementBase t, ProcessingContext context, PairProcessor<String, ProcessingContext> processor) { return processor.process(t.getName(), context); } }; }