void () { myFixture.addClass("package foo;\n\nimport java.lang.annotation.*;\n\n@Target(ElementType.TYPE_USE) public @interface TestNotNull { }"); NullableNotNullManager manager = NullableNotNullManager.getInstance(getProject()); manager.setNotNulls("foo.TestNotNull"); Disposer.register(myFixture.getTestRootDisposable(), manager::setNotNulls); doTest(); }