List<TextRange> (@NotNull List<? extends SubstitutionChunk> substitutions) { final List<TextRange> ranges = new ArrayList<>(); for (SubstitutionChunk substitution : substitutions) { ranges.add(TextRange.create(substitution.getStartIndex(), substitution.getEndIndex())); } return ranges; }