void (int... collapsedRegionOffsets) { int expectedNumberOfCollapsedRegions = collapsedRegionOffsets.length / 2; List<FoldRegion> foldRegions = ContainerUtil.filter(getEditor().getFoldingModel().getAllFoldRegions(), region -> !region.isExpanded()); assertEquals("Unexpected number of collapsed fold regions", expectedNumberOfCollapsedRegions, foldRegions.size()); for (int i = 0; i < expectedNumberOfCollapsedRegions; i++) { FoldRegion region = foldRegions.get(i); assertEquals("Unexpected region " + i + " start offset", collapsedRegionOffsets[i * 2], region.getStartOffset()); assertEquals("Unexpected region " + i + " end offset", collapsedRegionOffsets[i * 2 + 1], region.getEndOffset()); } }