private static ImmutableText valueOf(@NotNull CharSequence str, int start, int end) {
    int length = end - start;
    if (length <= BLOCK_SIZE) {
      return new ImmutableText(CharArrayUtil.fromSequence(str, start, end));
    }

    // Splits on a block boundary.
    int half = ((length + BLOCK_SIZE) >> 1) & BLOCK_MASK;
    return new ImmutableText(valueOf(str, start, start + half), valueOf(str, start + half, end));
  }