void () { openJavaEditor(""" class Foo { void m() { } }"""); executeAction(IdeActions.ACTION_COLLAPSE_ALL_REGIONS); checkFoldingState("[FoldRegion +(25:33), placeholder='{}']"); WriteCommandAction.writeCommandAction(getProject()).run(() -> getEditor().getDocument().insertString(0, "/*")); checkFoldingState("[FoldRegion -(0:37), placeholder='/.../', FoldRegion +(27:35), placeholder='{}']"); WriteCommandAction.runWriteCommandAction(getProject(), () -> getEditor().getDocument().deleteString(0, 2)); checkFoldingState("[FoldRegion +(25:33), placeholder='{}']"); }