void () { addDefaultLibrary(); myFixture.configureByFiles("lib/p/TestPrimitive.java", "content/anno/p/annotations.xml"); myFixture.configureByFiles("lib/p/Test.java"); final PsiFile file = myFixture.getFile(); final Editor editor = myFixture.getEditor(); // expecting other @Nullable annotations to be removed, and default @NotNull to be added List<Trinity<PsiModifierListOwner, String, Boolean>> expectedSequence = new ArrayList<>(); for (String notNull : NullableNotNullManager.getInstance(myFixture.getProject()).getNullables()) { expectedSequence.add(Trinity.create(getOwner(), notNull, false)); } expectedSequence.add(Trinity.create(getOwner(), AnnotationUtil.NOT_NULL, true)); startListening(expectedSequence); myFixture.launchAction(getAnnotateAction("NotNull")); FileDocumentManager.getInstance().saveAllDocuments(); final PsiElement psiElement = file.findElementAt(editor.getCaretModel().getOffset()); assertNotNull(psiElement); final PsiModifierListOwner listOwner = PsiTreeUtil.getParentOfType(psiElement, PsiModifierListOwner.class); assertNotNull(listOwner); assertNotNull(ExternalAnnotationsManager.getInstance(myFixture.getProject()).findExternalAnnotation(listOwner, AnnotationUtil.NOT_NULL)); stopListeningAndCheckEvents(); myFixture.checkResultByFile("content/anno/p/annotations.xml", "content/anno/p/annotationsAnnotateLibrary_after.xml", false); }