void () { PsiFile file = myFixture.addFileToProject("a.java", "class C {}"); DeferredIconImpl<?> icon1 = (DeferredIconImpl<?>)file.getIcon(0); assertFalse(icon1.isDone()); ensureEvaluated(icon1); WriteCommandAction.runWriteCommandAction(getProject(), () -> { file.getViewProvider().getDocument().insertString(0, " "); PsiDocumentManager.getInstance(getProject()).commitAllDocuments(); }); DeferredIconImpl<?> icon2 = (DeferredIconImpl<?>)file.getIcon(0); assertFalse(icon2.isDone()); assertEquals(icon1, icon2); ensureEvaluated(icon2); assertEquals(icon1, icon2); }