RemainingPrincipalCondition extends AbstractRangeCondition<BigDecimal> { public static RemainingPrincipalCondition lessThan(final int threshold) { final RangeCondition<BigDecimal> c = RangeCondition.lessThan(Wrapper::getRemainingPrincipal, PRINCIPAL_DOMAIN, BigDecimal.valueOf(threshold)); return new RemainingPrincipalCondition(c); } private  RemainingPrincipalCondition(final RangeCondition<BigDecimal> condition); static RemainingPrincipalCondition lessThan(final int threshold); static RemainingPrincipalCondition moreThan(final int threshold); static RemainingPrincipalCondition exact(final int minimumThreshold,
            final int maximumThreshold);  }
@Test void lessThan() { final MarketplaceFilterCondition condition = RemainingPrincipalCondition.lessThan(1); final Wrapper<?> w = mock(Wrapper.class); when(w.getRemainingPrincipal()).thenReturn(BigDecimal.ZERO); assertThat(condition).accepts(w); when(w.getRemainingPrincipal()).thenReturn(BigDecimal.ONE); assertThat(condition).rejects(w); }