code: public Locale getLocaleWithCountryAndVariant() {
      if (getCountries().length > 0) {
        if (getVariant() != null) {
          return new Locale(getShortCode(), getCountries()[0], getVariant());
        } else {
          return new Locale(getShortCode(), getCountries()[0]);
        }
      } else {
        return getLocale();
      }
    }
docs: Get this language's Java locale, considering language code and country code (if any).
  @since 2.1