code: static boolean validSurrogatePairAt(final String str, final int index) {
          return index >= 0 && index <= (str.length() - 2) && Character.isHighSurrogate(str.charAt(index)) && Character.isLowSurrogate(str.charAt(index + 1));
      }
docs: Note: copy rights: Google Guava.
  
  True when a valid surrogate pair starts at the given {@code index} in the
  given {@code string}. Out-of-range indexes return false.