code: public static <T extends MonetaryAmount> MonetaryAmountFactory<T> getAmountFactory(Class<T> amountType) {
          MonetaryAmountsSingletonSpi spi = Optional.ofNullable(monetaryAmountsSingletonSpi())
                  .orElseThrow(() -> new MonetaryException("No MonetaryAmountsSingletonSpi loaded."));
          MonetaryAmountFactory<T> factory = spi.getAmountFactory(amountType);
          return Optional.ofNullable(factory).orElseThrow(
                  () -> new MonetaryException("No AmountFactory available for type: " + amountType.getName()));
      }
docs: Access an {@link MonetaryAmountFactory} for the given {@link MonetaryAmount} implementation
  type.
  
  @param amountType {@link MonetaryAmount} implementation type, nor {@code null}.
  @return the corresponding {@link MonetaryAmountFactory}, never {@code null}.
  @throws MonetaryException if no {@link MonetaryAmountFactory} targeting the given {@link MonetaryAmount}
  implementation class is registered.