void (int startOffset, int endOffset, @Nullable String textInContent) { DocRenderItem item = DocRenderItemManager.getInstance().getItemAroundOffset(getEditor(), startOffset); assertNotNull("Item is not found at offset " + startOffset, item); assertEquals("Unexpected item start offset", startOffset, item.getHighlighter().getStartOffset()); assertEquals("Unexpected item end offset", endOffset, item.getHighlighter().getEndOffset()); Object toCheck = item.getFoldRegion(); if (textInContent == null) { assertNull("Item in rendered state", toCheck); } else { assertNotNull("Item not in rendered state", toCheck); assertTrue("Unexpected rendered text: " + item.getTextToRender(), item.getTextToRender() != null && item.getTextToRender().contains(textInContent)); } }