code: @Deprecated
      public static int[] codePoints(CharSequence s) {
          int[] result = new int[s.length()]; // in the vast majority of cases, the length is the same
          int j = 0;
          for (int i = 0; i < s.length(); ++i) {
              char cp = s.charAt(i);
              if (cp >= 0xDC00 && cp <= 0xDFFF && i != 0 ) { // hand-code for speed
                  char last = (char) result[j-1];
                  if (last >= 0xD800 && last <= 0xDBFF) {
                      // Note: j-1 is safe, because j can only be zero if i is zero. But i!=0 in this block.
                      result[j-1] = Character.toCodePoint(last, cp);
                      continue;
                  }
              }
              result[j++] = cp;
          }
          if (j == result.length) {
              return result;
          }
          int[] shortResult = new int[j];
          System.arraycopy(result, 0, shortResult, 0, j);
          return shortResult;
      }
docs: Utility function for simplified, more robust loops, such as:
  <pre>
  for (int codePoint : CharSequences.codePoints(string)) {
  doSomethingWith(codePoint);
  }
  </pre>
  
  @deprecated This API is ICU internal only.
  @hide draft / provisional / internal are hidden on Android