void () { @Language("JAVA") String text = """ class Foo { int someVeryVeryLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongVariable; // don't create folding that would exceed the right margin int getSomeVeryVeryLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongVariable() { return someVeryVeryLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongVariable; } } """; configure(text); FoldRegion[] regions = Stream.of(myFixture.getEditor().getFoldingModel().getAllFoldRegions()) .sorted(Comparator.comparingInt(reg -> reg.getStartOffset())).toArray(FoldRegion[]::new); assertEquals(1, regions.length); assertEquals("{...}", regions[0].getPlaceholderText()); }