void () { configure(""" class Foo { void m() { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { System.out.println(); } }); } }"""); assertTopLevelFoldRegionsState("[FoldRegion +(56:143), placeholder='(Runnable) () → { ', FoldRegion +(164:188), placeholder=' }']"); ((FoldingModelEx)myFixture.getEditor().getFoldingModel()).addListener(new FoldingListener() { @Override public void onFoldRegionStateChange(@NotNull FoldRegion region) { fail("Unexpected fold region change"); } @Override public void onFoldProcessingEnd() { fail("Unexpected fold regions change"); } }, myFixture.getTestRootDisposable()); myFixture.getEditor().getCaretModel().moveToOffset(myFixture.getEditor().getDocument().getText().indexOf("SwingUtilities")); myFixture.type(" "); myFixture.doHighlighting(); }