void () { myFixture.configureByFiles("src/rootRemoved/Foo.java", "content/anno/rootRemoved/annotations.xml"); Project project = myFixture.getProject(); PsiClass aClass = JavaPsiFacade.getInstance(project) .findClass("rootRemoved.Foo", GlobalSearchScope.projectScope(project)); assertNotNull(aClass); assertTrue(aClass.isDeprecated()); ModuleRootModificationUtil.updateModel(myFixture.getModule(), model -> { final JavaModuleExternalPaths extension = model.getModuleExtension(JavaModuleExternalPaths.class); extension.setExternalAnnotationUrls(ArrayUtil.EMPTY_STRING_ARRAY); }); assertFalse(aClass.isDeprecated()); }