code: public static <S extends CharSequence, U extends CharSequence, T extends Appendable> T hex(S s, int width, U separator, boolean useCodePoints, T result) {
          try {
              if (useCodePoints) {
                  int cp;
                  for (int i = 0; i < s.length(); i += UTF16.getCharCount(cp)) {
                      cp = Character.codePointAt(s, i);
                      if (i != 0) {
                          result.append(separator);
                      }
                      result.append(hex(cp,width));
                  }
              } else {
                  for (int i = 0; i < s.length(); ++i) {
                      if (i != 0) {
                          result.append(separator);
                      }
                      result.append(hex(s.charAt(i),width));
                  }
              }
              return result;
          } catch (IOException e) {
              throw new IllegalIcuArgumentException(e);
          }
      }
docs: Convert a string to separated groups of hex uppercase
  digits.  E.g., hex('ab'...) => "0041,0042".  Append the output
  to the given Appendable.