PsiMatcherExpression (@NotNull final String text) { return new PsiMatcherExpression() { @Override public Boolean match(PsiElement element) { if (element.getTextLength() != text.length()) return Boolean.FALSE; return text.equals(element.getText()); } }; }