private static int @NotNull [] getAllCodePoints(@NotNull CharSequence text) {
    IntList list = new IntArrayList(text.length());

    int len = text.length();
    int offset = 0;

    while (offset < len) {
      int ch = Character.codePointAt(text, offset);
      int charCount = Character.charCount(ch);

      list.add(ch);

      offset += charCount;
    }

    return list.toIntArray();
  }
private static int @NotNull [] getAllCodePoints(@NotNull CharSequence text)