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