code: public static int getSingleCodePoint(CharSequence s) {
          if (s == null || s.length() == 0) {
              return -1;
          } else if (s.length() == 1) {
              return s.charAt(0);
          } else if (s.length() > 2) {
              return -1;
          }
  
          // at this point, len = 2
          int cp = Character.codePointAt(s, 0);
          if (cp > 0xFFFF) { // is surrogate pair
              return cp;
          }
          return -1;
      }
docs: Utility for getting a code point from a CharSequence that contains exactly one code point.
  @return the code point IF the string is non-null and consists of a single code point.
  otherwise returns -1.
  @param s to test