code: public static Locale fromString(final String locale) {
          final String[] data = Strings.split(locale, '_');
          if (data.length == 1) {
              return new Locale(data[0]);
          } else if (data.length == 2) {
              return new Locale(data[0], data[1]);
          } else if (data.length == 3) {
              return new Locale(data[0], data[1], data[2]);
          }
          throw new IllegalArgumentException("Invalid locale string: " + locale);
      }
docs: A safe, cross-platform way of converting serialized locale string to {@link Locale} instance. Matches
  {@link #toString(Locale)} serialization implementation.
  
  @param locale locale converted to string.
  @return {@link Locale} stored the deserialized data.