code: private static int getType(int ch)
      {
          if (UCharacterUtility.isNonCharacter(ch)) {
              // not a character we return a invalid category count
              return NON_CHARACTER_;
          }
          int result = UCharacter.getType(ch);
          if (result == UCharacterCategory.SURROGATE) {
              if (ch <= UTF16.LEAD_SURROGATE_MAX_VALUE) {
                  result = LEAD_SURROGATE_;
              }
              else {
                  result = TRAIL_SURROGATE_;
              }
          }
          return result;
      }
docs: Gets the character extended type
  @param ch character to be tested
  @return extended type it is associated with