void () { @SuppressWarnings("ALL") @Language("JAVA") String text = """ /** * This is a header to collapse */ import java.util.*; class Foo { List a; Map b; } """; configure(text); FoldRegion foldRegion = myFixture.getEditor().getFoldingModel().getCollapsedRegionAtOffset(0); assertNotNull(foldRegion); assertEquals(0, foldRegion.getStartOffset()); assertEquals(text.indexOf("import") - 1, foldRegion.getEndOffset()); }