void () { PsiClass aClass = getFile("Annotated").getClasses()[0]; PsiModifierList modifierList = aClass.getModifierList(); assertNotNull(modifierList); PsiAnnotation[] annotations = modifierList.getAnnotations(); assertEquals(1, annotations.length); assertEquals("@pack.Annotation", annotations[0].getText()); PsiMethod method = aClass.getMethods()[1]; annotations = method.getModifierList().getAnnotations(); assertEquals(1, annotations.length); assertEquals("@pack.Annotation", annotations[0].getText()); PsiParameter[] params = method.getParameterList().getParameters(); assertEquals(1, params.length); modifierList = params[0].getModifierList(); assertNotNull(modifierList); annotations = modifierList.getAnnotations(); assertEquals(1, annotations.length); assertEquals("@pack.Annotation", annotations[0].getText()); modifierList = aClass.getFields()[0].getModifierList(); assertNotNull(modifierList); annotations = modifierList.getAnnotations(); assertEquals(1, annotations.length); assertEquals("@pack.Annotation", annotations[0].getText()); }