@Test(expectedExceptions = ArithmeticException.class) public void shouldReturnWhenTheValueIsBiggerThanLong() { CurrencyUnit real = Monetary.getCurrency("BRL"); MonetaryAmount monetaryAmount = Money.of(Long.MAX_VALUE, real); query.queryFrom(monetaryAmount.add(Money.of(10, real))); fail(); }
@Override public Long queryFrom(MonetaryAmount amount) { Objects.requireNonNull(amount, "Amount required."); return amount.with(downRounding).getNumber().longValueExact(); }
ExtractorMajorPartQuery implements MonetaryQuery<Long> { @Override public Long queryFrom(MonetaryAmount amount) { Objects.requireNonNull(amount, "Amount required."); return amount.with(downRounding).getNumber().longValueExact(); } }
ExtractorMajorPartQuery implements MonetaryQuery<Long> { @Override public Long queryFrom(MonetaryAmount amount) { Objects.requireNonNull(amount, "Amount required."); return amount.with(downRounding).getNumber().longValueExact(); } ExtractorMajorPartQuery(); }
ExtractorMajorPartQuery implements MonetaryQuery<Long> { @Override public Long queryFrom(MonetaryAmount amount) { Objects.requireNonNull(amount, "Amount required."); return amount.with(downRounding).getNumber().longValueExact(); } ExtractorMajorPartQuery(); @Override Long queryFrom(MonetaryAmount amount); }
ExtractorMajorPartQuery implements MonetaryQuery<Long> { @Override public Long queryFrom(MonetaryAmount amount) { Objects.requireNonNull(amount, "Amount required."); return amount.with(downRounding).getNumber().longValueExact(); } ExtractorMajorPartQuery(); @Override Long queryFrom(MonetaryAmount amount);  }