void () { Assume.assumeTrue(Registry.is("java.folding.icons.for.control.flow")); String text = """ class Test { void test(boolean b) { if (b) { System.out.println(); } } } """; configure(text); FoldingModelImpl foldingModel = (FoldingModelImpl)myFixture.getEditor().getFoldingModel(); final int indexOf = text.indexOf("System.out.println"); assertEquals(List.of("FoldRegion -(36:92), placeholder='{...}'", "FoldRegion -(50:88), placeholder='{...}'"), StreamEx.of(foldingModel.getAllFoldRegions()) .filter(region -> region.getStartOffset() < indexOf && indexOf < region.getEndOffset()) .map(FoldRegion::toString) .toList()); }