class ResourceBundleTools {

  private ResourceBundleTools() {
  }

  /**
   * Gets the ResourceBundle (i18n strings) for the default language of the user's system.
   */
  public static ResourceBundle getMessageBundle() {<FILL_FUNCTION_BODY>}

  /**
   * Gets the ResourceBundle (i18n strings) for the given user interface language.
   */
  public static ResourceBundle getMessageBundle(Language lang) {
    try {
      ResourceBundle bundle = JLanguageTool.getDataBroker().getResourceBundle(MESSAGE_BUNDLE, lang.getLocaleWithCountryAndVariant());
      if (!isValidBundleFor(lang, bundle)) {
        bundle = JLanguageTool.getDataBroker().getResourceBundle(MESSAGE_BUNDLE, lang.getLocale());
        if (!isValidBundleFor(lang, bundle)) {
          // happens if 'xx' is requested but only a MessagesBundle_xx_YY.properties exists:
          Language defaultVariant = lang.getDefaultLanguageVariant();
          if (defaultVariant != null && defaultVariant.getCountries().length > 0) {
            Locale locale = new Locale(defaultVariant.getShortCode(), defaultVariant.getCountries()[0]);
            bundle = JLanguageTool.getDataBroker().getResourceBundle(MESSAGE_BUNDLE, locale);
          }
        }
      }
      ResourceBundle fallbackBundle = JLanguageTool.getDataBroker().getResourceBundle(MESSAGE_BUNDLE, Locale.ENGLISH);
      return new ResourceBundleWithFallback(bundle, fallbackBundle);
    } catch (MissingResourceException e) {
      return JLanguageTool.getDataBroker().getResourceBundle(MESSAGE_BUNDLE, Locale.ENGLISH);
    }
  }

  private static boolean isValidBundleFor(Language lang, ResourceBundle bundle) {
    return lang.getLocale().getLanguage().equals(bundle.getLocale().getLanguage());
  }
}

    try {
      ResourceBundle bundle = JLanguageTool.getDataBroker().getResourceBundle(MESSAGE_BUNDLE, Locale.getDefault());
      ResourceBundle fallbackBundle = JLanguageTool.getDataBroker().getResourceBundle(MESSAGE_BUNDLE, Locale.ENGLISH);
      return new ResourceBundleWithFallback(bundle, fallbackBundle);
    } catch (MissingResourceException e) {
      return JLanguageTool.getDataBroker().getResourceBundle(MESSAGE_BUNDLE, Locale.ENGLISH);
    }
  
<no_super_class>