@NotNull
  public static LineOffsets create(@NotNull CharSequence text) {
    IntList ends = new IntArrayList();

    int index = 0;
    while (true) {
      int lineEnd = Strings.indexOf(text, '\n', index);
      if (lineEnd != -1) {
        ends.add(lineEnd);
        index = lineEnd + 1;
      }
      else {
        ends.add(text.length());
        break;
      }
    }

    return new LineOffsetsImpl(ends.toIntArray(), text.length());
  }
@NotNull
  public static LineOffsets create(@NotNull CharSequence text)