void () { @Language("JAVA") String text = """ public class Test { //region Foo interface Foo {void bar();} //endregion //region Bar void test() { } //endregion enum Bar { BAR1, BAR2 } }"""; configure(text); FoldingModelImpl foldingModel = (FoldingModelImpl)myFixture.getEditor().getFoldingModel(); int count = 0; for (FoldRegion region : foldingModel.getAllFoldRegions()) { if (region.getStartOffset() == text.indexOf("//region Foo")) { assertEquals("Foo", region.getPlaceholderText()); count++; } else if (region.getStartOffset() == text.indexOf("//region Bar")) { assertEquals("Bar", region.getPlaceholderText()); count++; } } assertEquals("Not all custom regions are found", 2, count); }