void () { addDefaultLibrary(); final PsiFile[] files = myFixture.configureByFiles("content/anno/edit/annotations.xml", "lib/edit/Foo.java"); final PsiClass fooJava = ((PsiClassOwner)files[1]).getClasses()[0]; ExternalAnnotationsManager.getInstance(myFixture.getProject()); PsiAnnotation annotation = AnnotationUtil.findAnnotation(fooJava, "java.lang.Deprecated"); assertNotNull(annotation); assertEquals("java.lang.Deprecated", annotation.getQualifiedName()); startListeningForExternalChanges(); myFixture.testAction(new CommentByLineCommentAction()); // comment out a line in annotations file PsiDocumentManager.getInstance(myFixture.getProject()).commitAllDocuments(); annotation = AnnotationUtil.findAnnotation(fooJava, "java.lang.Deprecated"); assertNull(annotation); }