code: public MonetaryAmountFormat getAmountFormat(AmountFormatQuery formatQuery) {
          Collection<MonetaryAmountFormat> formats = getAmountFormats(formatQuery);
          if (formats.isEmpty()) {
              throw new MonetaryException("No MonetaryAmountFormat for AmountFormatQuery " + formatQuery);
          }
          return formats.iterator().next();
      }
docs: Access an {@link javax.money.format.MonetaryAmountFormat} given a {@link javax.money.format
  .AmountFormatQuery}.
  
  @param formatQuery The format query defining the requirements of the formatter.
  @return the corresponding {@link javax.money.format.MonetaryAmountFormat}
  @throws javax.money.MonetaryException if no registered {@link javax.money.spi
  .MonetaryAmountFormatProviderSpi} can provide a
  corresponding {@link javax.money.format.MonetaryAmountFormat} instance.