void () { PsiElement target = resolve(); assertTrue(target instanceof PsiMethod); PsiMethod targetMethod = (PsiMethod)target; PsiType returnType = targetMethod.getReturnType(); assertEquals(PsiTypes.intType().createArrayType(), returnType); PsiJavaFile file = (PsiJavaFile)getFile(); PsiClass outerClass = file.getClasses()[0]; PsiClass record = outerClass.getInnerClasses()[0]; PsiRecordComponent[] components = record.getRecordComponents(); assertSize(1, components); assertEquals(target.getTextOffset(), components[0].getTextOffset()); assertEquals(List.of("F", "M", "T"), ContainerUtil.map(components[0].getAnnotations(), PsiAnnotation::getQualifiedName)); assertEquals(List.of("M", "T"), ContainerUtil.map(targetMethod.getAnnotations(), PsiAnnotation::getQualifiedName)); assertEquals(List.of("M", "T"), ContainerUtil.map(targetMethod.getModifierList().getAnnotations(), PsiAnnotation::getQualifiedName)); assertEquals(List.of("T1"), ContainerUtil.map(returnType.getAnnotations(), PsiAnnotation::getQualifiedName)); assertFalse(targetMethod.hasAnnotation("F")); assertFalse(targetMethod.getModifierList().hasAnnotation("F")); assertTrue(targetMethod.hasAnnotation("T")); assertTrue(targetMethod.getModifierList().hasAnnotation("T")); assertNull(targetMethod.getAnnotation("F")); assertTrue(targetMethod.hasAnnotation("M")); assertNotNull(targetMethod.getAnnotation("M")); assertNotNull(targetMethod.getModifierList().findAnnotation("M")); }