void () { RecursionManager.disableMissedCacheAssertions(getTestRootDisposable()); final PsiClass clazz = myFixture.addClass("class Foo {}"); assert clazz.equals(myFixture.findClass("Foo")); DumbModeTestUtils.runInDumbModeSynchronously(getProject(), () -> { final CachedValue<PsiClass> stubQuery = CachedValuesManager.getManager(getProject()).createCachedValue(() -> { return CachedValueProvider.Result.create(myFixture.getJavaFacade().findClass("Foo", GlobalSearchScope.allScope(getProject())),PsiModificationTracker.MODIFICATION_COUNT); }); FileBasedIndex.getInstance().ignoreDumbMode(DumbModeAccessType.RELIABLE_DATA_ONLY, () -> { assert clazz.equals(stubQuery.getValue()); WriteCommandAction.runWriteCommandAction(getProject(), (Computable<PsiElement>)() -> clazz.setName("Bar")); assert null == stubQuery.getValue(); }); }); }