public int nextIndex(int index) {
        int next = index + 1;
        if (next < s.length() && Character.isLowSurrogate(s.charAt(next)))
            next++;
        return next;
    }
Returns the index of the next code point after the given index (which may be past the end of the string)
vespajlib/src/main/java/com/yahoo/text/UnicodeString.java