void () { PsiFile file = myFixture.configureByFile("src/withAnnotation/Foo.java"); PsiMethod method = PsiTreeUtil.getParentOfType(myFixture.getElementAtCaret(), PsiMethod.class, false); assertNotNull(method); AddAnnotationPsiFix.createAddNullableFix(method).invoke(myFixture.getProject(), file, method, method); myFixture.checkResultByFile("src/withAnnotation/Foo_after.java"); }