void (int[] newLineStartOffsets, Iterator<Block> iterator) { int i = 0; while (iterator.hasNext()) { Block next = iterator.next(); Assert.assertTrue("Extra new line block found: " + next.getTextRange(), i < newLineStartOffsets.length); Assert.assertEquals("Block start offset do not match ", newLineStartOffsets[i++], next.getTextRange().getStartOffset()); } Assert.assertEquals("Not detected new line block start offset ", i, newLineStartOffsets.length); }