ElapsedLoanTermCondition extends AbstractRangeCondition<Integer> { public static ElapsedLoanTermCondition exact(final int minimumThreshold, final int maximumThreshold) { final RangeCondition<Integer> c = RangeCondition.exact(ElapsedLoanTermCondition::getElapsedTerm, LOAN_TERM_IN_MONTHS_DOMAIN, minimumThreshold, maximumThreshold); return new ElapsedLoanTermCondition(c); } private  ElapsedLoanTermCondition(final RangeCondition<Integer> condition); static ElapsedLoanTermCondition lessThan(final int threshold); static ElapsedLoanTermCondition moreThan(final int threshold); static ElapsedLoanTermCondition exact(final int minimumThreshold, final int maximumThreshold);  }
@Test void exact() { final MarketplaceFilterCondition condition = ElapsedLoanTermCondition.exact(0, 1); final Wrapper<?> w = mock(Wrapper.class); when(w.getOriginalTermInMonths()).thenReturn(10); when(w.getRemainingTermInMonths()).thenReturn(10); assertThat(condition).accepts(w); when(w.getRemainingTermInMonths()).thenReturn(9); assertThat(condition).accepts(w); when(w.getRemainingTermInMonths()).thenReturn(8); assertThat(condition).rejects(w); }
@Test void hasDescription() { final MarketplaceFilterCondition condition = ElapsedLoanTermCondition.exact(1, 1); assertThat(condition.getDescription()).isNotEmpty(); }