code: public static boolean isSurrogatePair(String text, int idx) {
          if (idx < 0 || idx > text.length() - 2)
              return false;
          return isSurrogateHigh(text.charAt(idx)) && isSurrogateLow(text.charAt(idx + 1));
      }
docs: Checks if two subsequent characters in a String are
  are the higher and the lower character in a surrogate
  pair (and therefore eligible for conversion to a UTF 32 character).
  @param text	the String with the high and low surrogate characters
  @param idx	the index of the 'high' character in the pair
  @return	true if the characters are surrogate pairs
  @since	2.1.2