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