question: static void adjustIndicesForSupplementaryChars ( StringBuilder content , FormattedTweetText formattedTweetText ) { final List < Integer > highSurrogateIndices = new ArrayList < > ( ) ; final int len = content . length ( ) - 1 ; for ( int i = 0 ; i < len ; ++ i ) { if ( Character . isHighSurrogate ( content . charAt ( i ) ) && Character . isLowSurrogate ( content . charAt ( i + 1 ) ) ) { highSurrogateIndices . add ( i ) ; } } adjustEntitiesWithOffsets ( formattedTweetText . urlEntities , highSurrogateIndices ) ; adjustEntitiesWithOffsets ( formattedTweetText . mediaEntities , highSurrogateIndices ) ; }
target:  Adjusts entity indices for supplementary characters (Emoji being the most common example) in UTF-8 (ones outside of U+0000 to U+FFFF range) are represented as a pair of char values, the first from the high-surrogates range, and the second from the low-surrogates range.