PsiMatcherExpression (@NotNull final Class<?> aClass) { return new PsiMatcherExpression() { @Override public Boolean match(PsiElement element) { if (aClass.isAssignableFrom(element.getClass())) return Boolean.TRUE; return Boolean.FALSE; } }; }