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