List<RangeMarker> (DocumentEx document, int... offsets) { List<RangeMarker> result = new ArrayList<>(); for (int i=0; i<offsets.length; i+=2) { int start = offsets[i]; int end = offsets[i+1]; RangeMarker m = document.createRangeMarker(start, end); result.add(m); } return result; }