@Test public void testGetMoneyWithSpecification() throws Exception { MonetaryAmount amt = basics.getMoneyWithSpecificCapabilities(new BigDecimal("10.50792323200000000000236823"), "CHF"); assertNotNull(amt); assertEquals("CHF", amt.getCurrency().getCurrencyCode()); assertEquals(new BigDecimal("10.50792323200000000000236823"), amt.getNumber().numberValue(BigDecimal.class)); MonetaryContext ctx = amt.getContext(); assertTrue(ctx.getMaxScale() >= 128); assertTrue(ctx.getPrecision() >= 256 || ctx.getPrecision() == 0); assertEquals(ctx.get(RoundingMode.class), RoundingMode.FLOOR); amt = basics.getMoneyWithSpecificCapabilities(6546546464L, "USD"); assertNotNull(amt); assertEquals("USD", amt.getCurrency().getCurrencyCode()); assertEquals(6546546464L, amt.getNumber().longValueExact()); assertTrue(ctx.getMaxScale() >= 128); assertTrue(ctx.getPrecision() >= 256 || ctx.getPrecision() == 0); assertEquals(ctx.get(RoundingMode.class), RoundingMode.FLOOR); }
public MonetaryAmount getMoneyWithSpecificCapabilities(Number number, String currencyCode){ throw new UnsupportedOperationException(); }
Basics { public MonetaryAmount getMoneyWithSpecificCapabilities(Number number, String currencyCode){ throw new UnsupportedOperationException(); } }
Basics { public MonetaryAmount getMoneyWithSpecificCapabilities(Number number, String currencyCode){ throw new UnsupportedOperationException(); }  }
Basics { public MonetaryAmount getMoneyWithSpecificCapabilities(Number number, String currencyCode){ throw new UnsupportedOperationException(); }  CurrencyUnit getProvidedCurrency(String currencyCode); CurrencyUnit getProvidedCurrency(Locale locale); CurrencyUnit buildCustomCurrency(String currencyCode, int numericCode, int defaultFractionUnits); CurrencyUnit buildAndRegisterCustomCurrency(String currencyCode, int numericCode, int defaultFractionUnits); Collection<Class<? extends MonetaryAmount>> getMonetaryAmountTypes(); Class<? extends MonetaryAmount> getDefaultMonetaryAmountType(); MonetaryAmountFactory<T> getMoneyFactory(Class<T> moneyType); MonetaryAmount getMoney(Number number, String currencyCode); MonetaryAmount convertAmount(MonetaryAmount amount, BigDecimal bd, String currencyCode); MonetaryAmount convertAmount(MonetaryAmount amount, int scale, int precision, MathContext context); MonetaryAmount getMoneyWithContext(Number number, String currencyCode, MonetaryContext context); MonetaryAmount getMoneyWithSpecificCapabilities(Number number, String currencyCode); }
Basics { public MonetaryAmount getMoneyWithSpecificCapabilities(Number number, String currencyCode){ throw new UnsupportedOperationException(); }  CurrencyUnit getProvidedCurrency(String currencyCode); CurrencyUnit getProvidedCurrency(Locale locale); CurrencyUnit buildCustomCurrency(String currencyCode, int numericCode, int defaultFractionUnits); CurrencyUnit buildAndRegisterCustomCurrency(String currencyCode, int numericCode, int defaultFractionUnits); Collection<Class<? extends MonetaryAmount>> getMonetaryAmountTypes(); Class<? extends MonetaryAmount> getDefaultMonetaryAmountType(); MonetaryAmountFactory<T> getMoneyFactory(Class<T> moneyType); MonetaryAmount getMoney(Number number, String currencyCode); MonetaryAmount convertAmount(MonetaryAmount amount, BigDecimal bd, String currencyCode); MonetaryAmount convertAmount(MonetaryAmount amount, int scale, int precision, MathContext context); MonetaryAmount getMoneyWithContext(Number number, String currencyCode, MonetaryContext context); MonetaryAmount getMoneyWithSpecificCapabilities(Number number, String currencyCode);  }