void (FoldRegion activeFoldRegion, Object... expectedAnchorParameters) { Collection<DisplayedFoldingAnchor> actualAnchors = new FoldingAnchorsOverlayStrategy((EditorImpl)myFixture.getEditor()) .getAnchorsToDisplay(0, myFixture.getEditor().getDocument().getTextLength(), Collections.singletonList(activeFoldRegion)); List<DisplayedFoldingAnchor> sortedActualAnchors = new ArrayList<>(actualAnchors); Collections.sort(sortedActualAnchors, Comparator.comparingInt(o -> o.visualLine)); assertEquals("Wrong number of anchors", expectedAnchorParameters.length / 2, sortedActualAnchors.size()); int i = 0; for (DisplayedFoldingAnchor anchor : sortedActualAnchors) { int expectedVisualLine = (Integer) expectedAnchorParameters[i++]; assertEquals("Folding anchor at wrong line found", expectedVisualLine, anchor.visualLine); Type expectedType = (Type)expectedAnchorParameters[i++]; assertEquals("Folding anchor of wrong type found at line " + expectedVisualLine, expectedType, anchor.type); } }