void () { AtomicBoolean setting = new AtomicBoolean(true); runWithCustomFoldingBuilder(new TestFoldingBuilder() { @NotNull @Override public String getPlaceholderText(@NotNull ASTNode node) { return setting.get() ? "foo" : "bar"; } @Override public boolean isCollapsedByDefault(@NotNull ASTNode node) { return setting.get(); } }, () -> { openEditor("<caret>\nvalue", PlainTextFileType.INSTANCE); checkFoldingState("[FoldRegion +(1:6), placeholder='foo']"); setting.set(false); runFoldingPass(); checkFoldingState("[FoldRegion -(1:6), placeholder='bar']"); }); }