Self (final ElementPattern<? extends PsiMetaData> metaDataPattern) { return with(new PatternCondition<T>("withMetaData") { @Override public boolean accepts(final @NotNull T t, final ProcessingContext context) { return t instanceof PsiMetaOwner && metaDataPattern.accepts(((PsiMetaOwner)t).getMetaData(), context); } }); }