boolean (PsiElement owner, Class<? extends PsiModifierListOwner> @NotNull [] types) { for (Class<? extends PsiModifierListOwner> type : types) { if(type.isInstance(owner)) return true; } return false; }