int (Number parent, List<<warning descr="Can generalize to '? extends Number'">Number</warning>> blocks, List<<warning descr="Can generalize to '? super Number'">Number</warning>> result, int startOffset, int endOffset, int depth) { int lastOffset = startOffset; String currRange = ""; for (Number block : blocks) { if (lastOffset == endOffset || block.intValue() > endOffset) return lastOffset; if (currRange.contains("block")) { result.add(block); lastOffset = block.intValue(); currRange += endOffset; } else if (currRange.equals(block.toString())) { lastOffset = fillGap(block, blocks.subList(0, lastOffset), result, lastOffset, endOffset, depth + 1); currRange += lastOffset; } } return lastOffset; }