LoanInterestRateCondition extends AbstractRangeCondition<Ratio> { public static LoanInterestRateCondition exact(final Ratio minimumThreshold, final Ratio maximumThreshold) { final RangeCondition<Ratio> c = RangeCondition.exact(Wrapper::getInterestRate, RATE_DOMAIN, minimumThreshold, maximumThreshold); return new LoanInterestRateCondition(c); } private  LoanInterestRateCondition(final RangeCondition<Ratio> condition); static LoanInterestRateCondition lessThan(final Ratio threshold); static LoanInterestRateCondition moreThan(final Ratio threshold); static LoanInterestRateCondition exact(final Ratio minimumThreshold, final Ratio maximumThreshold);  }
@Test void exact() { final MarketplaceFilterCondition condition = LoanInterestRateCondition.exact(Ratio.ZERO, Ratio.fromPercentage(1)); final Wrapper<?> w = mock(Wrapper.class); when(w.getInterestRate()).thenReturn(Ratio.ZERO); assertThat(condition).accepts(w); when(w.getInterestRate()).thenReturn(Ratio.fromPercentage(1)); assertThat(condition).accepts(w); when(w.getInterestRate()).thenReturn(Ratio.ONE); assertThat(condition).rejects(w); }