private static boolean processCodePoints(@NotNull CharSequence str, int startIncl, int endExcl, CodePointProcessor processor) {
    int i = startIncl;
    while (i < endExcl) {
      char c1 = str.charAt(i++);
      if (!Character.isHighSurrogate(c1) || i >= endExcl) {
        if (!processor.acceptCodePoint(c1)) return false;
      }
      else {
        char c2 = str.charAt(i);
        if (Character.isLowSurrogate(c2)) {
          i++;
          if (!processor.acceptCodePoint(Character.toCodePoint(c1, c2))) return false;
        }
        else {
          if (!processor.acceptCodePoint(c2)) return false;
        }
      }
    }
    return true;
  }
private static boolean processCodePoints(@NotNull CharSequence str, int startIncl, int endExcl, CodePointProcessor processor)