### Question:
GlobalMessageUtil { protected static String getLocaleString( Locale locale ) { final StringBuilder localeString = new StringBuilder(); if ( locale != null && !StringUtils.isBlank( locale.getLanguage() ) ) { if ( !StringUtils.isBlank( locale.getCountry() ) ) { localeString.append( locale.getLanguage().toLowerCase() ).append( '_' ).append( locale.getCountry().toUpperCase() ); } else { localeString.append( locale.getLanguage().toLowerCase() ); } } return localeString.toString(); }  static String formatErrorMessage( String key, String msg ); static String getString( ResourceBundle bundle, String key ); static String getErrorString( ResourceBundle bundle, String key ); static String getString( ResourceBundle bundle, String key, String param1 ); static String getErrorString( ResourceBundle bundle, String key, String param1 ); static String getString( ResourceBundle bundle, String key, String param1, String param2 ); static String getErrorString( ResourceBundle bundle, String key, String param1, String param2 ); static String getString( ResourceBundle bundle, String key, String param1, String param2, String param3 ); static String getErrorString( ResourceBundle bundle, String key, String param1, String param2,
                                       String param3 ); static String getString( ResourceBundle bundle, String key, String param1, String param2, String param3,
                                  String param4 ); static String getString( ResourceBundle bundle, String key, String param1, String param2, String param3,
                                  String param4, String param5 ); static String getString( ResourceBundle bundle, String key, String param1, String param2, String param3,
                                  String param4, String param5, String param6 ); static String getErrorString( ResourceBundle bundle, String key, String param1, String param2,
                                       String param3, String param4 ); static void setLocale( Locale newLocale ); static Locale getLocale(); static LinkedHashSet<Locale> getActiveLocales(); static String calculateString( final String[] pkgNames, final String key, final Object[] parameters,
                                        final Class<?> resourceClass, final String bundleName ); static String calculateString( final String[] pkgNames, final String key, Object[] parameters,
                                        final Class<?> resourceClass, final String bundleName,
                                        final boolean fallbackOnRoot ); static String calculateString( final String[] pkgNames, final String key, final Object[] parameters,
                                        final Class<?> resourceClass, final String bundleName,
                                        final boolean logNotFoundError, final boolean fallbackOnRoot ); static ResourceBundle getBundle( final String packagePath, final Class<?> resourceClass ); static ResourceBundle getBundle( Locale locale, String packagePath, Class<?> resourceClass ); static ResourceBundle getBundle( final Locale locale, final String packagePath, final Class<?> resourceClass,
                                          final boolean fallbackOnRoot ); static final Locale FAILOVER_LOCALE; }### Answer:
@Test public void testGetLocaleString() { Assert.assertEquals( "", GlobalMessageUtil.getLocaleString( null ) ); Assert.assertEquals( "", GlobalMessageUtil.getLocaleString( new Locale( "" ) ) ); Assert.assertEquals( "en", GlobalMessageUtil.getLocaleString( Locale.ENGLISH ) ); Assert.assertEquals( "en_US", GlobalMessageUtil.getLocaleString( Locale.US ) ); Assert.assertEquals( "en", GlobalMessageUtil.getLocaleString( new Locale( "EN" ) ) ); Assert.assertEquals( "en_US", GlobalMessageUtil.getLocaleString( new Locale( "EN", "us" ) ) ); }