Self (final ElementPattern<String> localName) { return with(new PsiNamePatternCondition<>("withLocalName", localName) { @Override public String getPropertyValue(@NotNull final Object o) { return o instanceof XmlElement ? getLocalName((T)o) : null; } }); }