@Test public void shouldReturnMajorPartPositive() { MonetaryAmount monetaryAmount = Money.parse("EUR 2.35"); Long result = query.queryFrom(monetaryAmount); Long expected = 2L; assertEquals(result, expected ); }
@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);  }