Boolean (PsiElement element) { PsiModifierListOwner owner = element instanceof PsiModifierListOwner ? (PsiModifierListOwner) element : null; if (owner != null && owner.hasModifierProperty(modifier) == shouldHave) return Boolean.TRUE; return Boolean.FALSE; }