void () { addLibrary(); // no annotation roots: all operations should fail myFixture.configureByFiles("lib/p/Test.java"); final PsiMethod method = ((PsiJavaFile)myFixture.getFile()).getClasses()[0].getMethods()[0]; startListening(method, AnnotationUtil.NOT_NULL, false); ExternalAnnotationsManager.getInstance(myFixture.getProject()).annotateExternally(method, AnnotationUtil.NOT_NULL, myFixture.getFile(), null); stopListeningAndCheckEvents(); startListening(method, AnnotationUtil.NOT_NULL, false); WriteCommandAction.runWriteCommandAction(myFixture.getProject(), () -> { ExternalAnnotationsManager.getInstance(myFixture.getProject()).editExternalAnnotation(method, AnnotationUtil.NOT_NULL, null); }); stopListeningAndCheckEvents(); startListening(method, AnnotationUtil.NOT_NULL, false); WriteCommandAction.runWriteCommandAction(myFixture.getProject(), () -> { ExternalAnnotationsManager.getInstance(myFixture.getProject()).deannotate(method, AnnotationUtil.NOT_NULL); }); stopListeningAndCheckEvents(); }