TextRange (@NotNull List<? extends MergeableLineMarkerInfo<?>> markers) { int startOffset = Integer.MAX_VALUE; int endOffset = Integer.MIN_VALUE; for (MergeableLineMarkerInfo<?> marker : markers) { startOffset = Math.min(startOffset, marker.startOffset); endOffset = Math.max(endOffset, marker.endOffset); } return TextRange.create(startOffset, endOffset); }