PhoneNumberHandlerBase { public static String getGeocoderDescriptionForNumber(Object data, String regionCode, Locale languageCode) { return getGeocoderDescriptionForNumber(parseToPhoneNumber(data, regionCode), languageCode); }  static PhoneNumber parseToPhoneNumber(Object data, String regionCode); static boolean isValidPhoneNumber(Object data, String regionCode); static boolean isPossiblePhoneNumber(Object data, String regionCode); static String formatE164(Object data, String regionCode); static String formatInternational(Object data, String regionCode); static String formatNational(Object data, String regionCode); static String formatRFC396(Object data, String regionCode); static Set<String> getSupportedRegions(); static int getCountryCodeForRegion(String regionCode); static int getCountryCodeForPhoneNumber(PhoneNumber number); static PhoneNumberTypeEnum getPhoneNumberType(Object data, String regionCode); static PhoneNumberTypeEnum getPhoneNumberType(PhoneNumber number); static boolean containsValidRegionCode(Object data); static String extractRegionCode(Object phoneData); static String extractRegionCode(Object phoneData, String regionCode); static String extractRegionCode(PhoneNumber phoneNumber); static int extractCountrycode(Object phoneData); static String getGeocoderDescriptionForNumber(Object data, String regionCode, Locale languageCode); static String getGeocoderDescriptionForNumber(PhoneNumber number, Locale languageCode); static String getCarrierNameForNumber(Object data, String regionCode, Locale languageCode); static String getCarrierNameForNumber(PhoneNumber number, Locale languageCode); static List<String> getTimeZonesForNumber(Object data, String regionCode); static List<String> getTimeZonesForNumber(PhoneNumber number); static List<String> getTimeZonesForNumber(Object data, String regionCode, boolean withUnknownTimeZone); static List<String> getTimeZonesForNumber(PhoneNumber phoneNumber, boolean withUnknownTimeZone);  }
@Test public void testgetGeocoderDescriptionForNumber() { assertEquals(StringUtils.EMPTY, PhoneNumberHandlerBase.getGeocoderDescriptionForNumber(null, REGCODE_CN, Locale.SIMPLIFIED_CHINESE)); assertEquals("北京市", PhoneNumberHandlerBase.getGeocoderDescriptionForNumber(CN_NUM_3, REGCODE_CN, Locale.SIMPLIFIED_CHINESE)); assertEquals("Beijing", PhoneNumberHandlerBase.getGeocoderDescriptionForNumber(CN_NUM_3, REGCODE_CN, Locale.UK)); assertEquals("江西省九江市", PhoneNumberHandlerBase.getGeocoderDescriptionForNumber(CN_NUM_4, REGCODE_CN, Locale.SIMPLIFIED_CHINESE)); assertEquals("Jiujiang, Jiangxi", PhoneNumberHandlerBase.getGeocoderDescriptionForNumber(CN_NUM_4, REGCODE_CN, Locale.UK)); assertEquals("France", PhoneNumberHandlerBase.getGeocoderDescriptionForNumber(FR_NUM_1, REGCODE_FR, Locale.FRANCE)); assertEquals("Paris", PhoneNumberHandlerBase.getGeocoderDescriptionForNumber(FR_NUM_2, REGCODE_FR, Locale.FRANCE)); assertEquals(StringUtils.EMPTY, PhoneNumberHandlerBase.getGeocoderDescriptionForNumber(FR_NUM_3, REGCODE_FR, Locale.FRANCE)); assertEquals(StringUtils.EMPTY, PhoneNumberHandlerBase.getGeocoderDescriptionForNumber(FR_NUM_4, REGCODE_FR, Locale.FRANCE)); assertEquals("France", PhoneNumberHandlerBase.getGeocoderDescriptionForNumber(FR_NUM_5, REGCODE_FR, Locale.FRANCE)); assertEquals("Corvallis, OR", PhoneNumberHandlerBase.getGeocoderDescriptionForNumber(US_NUM_1, REGCODE_US, Locale.US)); assertEquals("Corvallis, OR", PhoneNumberHandlerBase.getGeocoderDescriptionForNumber(US_NUM_2, REGCODE_US, Locale.US)); assertEquals(StringUtils.EMPTY, PhoneNumberHandlerBase.getGeocoderDescriptionForNumber(US_NUM_3, REGCODE_US, Locale.US)); assertEquals("Corvallis, OR", PhoneNumberHandlerBase.getGeocoderDescriptionForNumber(US_NUM_4, REGCODE_US, Locale.US)); assertEquals(StringUtils.EMPTY, PhoneNumberHandlerBase.getGeocoderDescriptionForNumber(US_NUM_5, REGCODE_US, Locale.US)); assertEquals(StringUtils.EMPTY, PhoneNumberHandlerBase.getGeocoderDescriptionForNumber(US_NUM_6, REGCODE_US, Locale.US)); assertEquals("Pennsylvania", PhoneNumberHandlerBase.getGeocoderDescriptionForNumber(US_NUM_7, REGCODE_US, Locale.US)); assertEquals("München", PhoneNumberHandlerBase.getGeocoderDescriptionForNumber(DE_NUM_1, REGCODE_DE, Locale.GERMANY)); assertEquals("Munich", PhoneNumberHandlerBase.getGeocoderDescriptionForNumber(DE_NUM_1, REGCODE_DE, Locale.ENGLISH)); assertEquals(StringUtils.EMPTY, PhoneNumberHandlerBase.getGeocoderDescriptionForNumber(DE_NUM_2, REGCODE_DE, Locale.GERMANY)); assertEquals("München", PhoneNumberHandlerBase.getGeocoderDescriptionForNumber(DE_NUM_3, REGCODE_DE, Locale.GERMANY)); assertEquals("Nußbach Pfalz", PhoneNumberHandlerBase.getGeocoderDescriptionForNumber(DE_NUM_4, REGCODE_DE, Locale.GERMANY)); assertEquals("Nussbach Pfalz", PhoneNumberHandlerBase.getGeocoderDescriptionForNumber(DE_NUM_4, REGCODE_DE, Locale.ENGLISH)); assertEquals("東京", PhoneNumberHandlerBase.getGeocoderDescriptionForNumber(JP_NUM_1, REGCODE_JP, Locale.JAPAN)); assertEquals("日本", PhoneNumberHandlerBase.getGeocoderDescriptionForNumber(JP_NUM_2, REGCODE_JP, Locale.JAPAN)); assertEquals("平塚", PhoneNumberHandlerBase.getGeocoderDescriptionForNumber(JP_NUM_3, REGCODE_JP, Locale.JAPAN)); assertEquals("日本", PhoneNumberHandlerBase.getGeocoderDescriptionForNumber(JP_NUM_4, REGCODE_JP, Locale.JAPAN)); assertEquals(StringUtils.EMPTY, PhoneNumberHandlerBase.getGeocoderDescriptionForNumber(JP_NUM_5, REGCODE_JP, Locale.JAPAN)); }