void () { PsiClass psiClass = myFixture.addClass("class C {}"); WriteCommandAction.runWriteCommandAction(getProject(), () -> { PsiField field = psiClass.findFieldByName(AUGMENTED_FIELD, false); assertTrue(field.isValid()); getPsiManager().dropPsiCaches(); assertFalse(field.isValid()); PsiUtilCore.ensureValid(psiClass.findFieldByName(AUGMENTED_FIELD, false)); }); }