public static boolean isSurrogatePair(String text,int idx){
  return !(idx < 0 || idx > text.length() - 2) && isSurrogateHigh(text.charAt(idx)) && isSurrogateLow(text.charAt(idx + 1));
}

public static boolean isSurrogatePair ( String text , int idx ) { return ! ( idx < 0 || idx > text . length ( ) - 2 ) && isSurrogateHigh ( text . charAt ( idx ) ) && isSurrogateLow ( text . charAt ( idx + 1 ) ) ; }
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 ) .
