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