code: public static String getBestMatch(final Locale locale, final MultiLanguageTextOrBuilder multiLanguageText) throws NotAvailableException {
          try {
              // resolve multiLanguageText via preferred locale.
              return getMultiLanguageTextByLanguage(locale.getLanguage(), multiLanguageText);
          } catch (NotAvailableException ex) {
              try {
                  // resolve world language multiLanguageText.
                  return getMultiLanguageTextByLanguage(Locale.ENGLISH, multiLanguageText);
              } catch (NotAvailableException exx) {
                  // resolve any multiLanguageText.
                  return getFirstMultiLanguageText(multiLanguageText);
              }
          }
      }
docs: Get the first multiLanguageText for a languageCode from a multiLanguageText type. This is equivalent to calling
  {@link #getMultiLanguageTextByLanguage(String, MultiLanguageTextOrBuilder)} but the language code is extracted from the locale by calling
  {@link Locale#getLanguage()}. If no multiLanguageText matches the languageCode, than the first multiLanguageText of any other provided language is returned.
  
  @param locale      the locale from which a language code is extracted
  @param multiLanguageText the multiLanguageText type which is searched for multiLanguageTexts in the language
  
  @return the first multiLanguageText from the multiLanguageText type for the locale
  
  @throws NotAvailableException if no multiLanguageText is provided by the {@code multiLanguageText} argument.