LoanAmountCondition extends AbstractRangeCondition<Integer> { public static LoanAmountCondition lessThan(final int threshold) { final RangeCondition<Integer> c = RangeCondition.lessThan(Wrapper::getOriginalAmount, AMOUNT_DOMAIN, threshold); return new LoanAmountCondition(c); } private  LoanAmountCondition(final RangeCondition<Integer> condition); static LoanAmountCondition lessThan(final int threshold); static LoanAmountCondition moreThan(final int threshold); static LoanAmountCondition exact(final int minimumThreshold, final int maximumThreshold);  }
@Test void lessThan() { final MarketplaceFilterCondition condition = LoanAmountCondition.lessThan(1); final Wrapper<?> w = mock(Wrapper.class); when(w.getOriginalAmount()).thenReturn(0); assertThat(condition).accepts(w); when(w.getOriginalAmount()).thenReturn(1); assertThat(condition).rejects(w); }