void () { PsiFile file = myFixture.configureByFile(getTestName(false) + ".java"); PsiClass innerClass = PsiTreeUtil.getParentOfType(file.findElementAt(myFixture.getCaretOffset()), PsiClass.class); assertNotNull(innerClass); assertNotNull(innerClass.getModifierList()); PsiElement parent = innerClass.getParent(); assertNotNull(parent); assertTrue(parent instanceof PsiClass); PsiClass parentClass = (PsiClass) parent; assertNotNull(parentClass.getModifierList()); assertTrue("@UtilityClass should make parent class final", ((PsiClass) innerClass.getParent()).getModifierList().hasModifierProperty(PsiModifier.FINAL)); assertTrue("@UtilityClass should make inner class static", innerClass.getModifierList().hasModifierProperty(PsiModifier.STATIC)); }