@Test public void testGetJDKNumber() throws Exception{ BigDecimal bd = new BigDecimal("0.1234523"); MonetaryAmount[] amounts = new MonetaryAmount[]{Money.of(bd, "USD"), FastMoney.of(2334434354L, "CHF")}; for(MonetaryAmount amount : amounts){ assertTrue("JDK Number can be more easily extracted for " + amount, np.getNumber(amount) instanceof NumberValue); assertEquals("Invalid JDK Number for " + amount, amount.getNumber(), np.getNumber(amount)); } }
public Number getNumber(MonetaryAmount amount){ throw new UnsupportedOperationException(); }
NumericRepresentation { public Number getNumber(MonetaryAmount amount){ throw new UnsupportedOperationException(); } }
NumericRepresentation { public Number getNumber(MonetaryAmount amount){ throw new UnsupportedOperationException(); }  }
NumericRepresentation { public Number getNumber(MonetaryAmount amount){ throw new UnsupportedOperationException(); }  BigDecimal getBigDecimal(MonetaryAmount amount); long getLongTruncated(MonetaryAmount amount); int getPrecision(MonetaryAmount amount); int getScale(MonetaryAmount amount); long getFractionDenominator(MonetaryAmount amount); long getFractionNumerator(MonetaryAmount amount); Class<?> getNumberType(MonetaryAmount amount); Number getNumber(MonetaryAmount amount); }
NumericRepresentation { public Number getNumber(MonetaryAmount amount){ throw new UnsupportedOperationException(); }  BigDecimal getBigDecimal(MonetaryAmount amount); long getLongTruncated(MonetaryAmount amount); int getPrecision(MonetaryAmount amount); int getScale(MonetaryAmount amount); long getFractionDenominator(MonetaryAmount amount); long getFractionNumerator(MonetaryAmount amount); Class<?> getNumberType(MonetaryAmount amount); Number getNumber(MonetaryAmount amount);  }