code: protected char scanSurrogates() {
          if (surrogatesSupported && Character.isHighSurrogate(ch)) {
              char high = ch;
  
              scanChar();
  
              if (Character.isLowSurrogate(ch)) {
                  return high;
              }
  
              ch = high;
          }
  
          return 0;
      }
docs: Scan surrogate pairs.  If 'ch' is a high surrogate and
  the next character is a low surrogate, then put the low
  surrogate in 'ch', and return the high surrogate.
  otherwise, just return 0.