NegatingCondition extends MarketplaceFilterConditionImpl { @Override public boolean test(final Wrapper<?> item) { return !toNegate.test(item); } NegatingCondition(final MarketplaceFilterCondition toNegate); MarketplaceFilterCondition getToNegate(); @Override Optional<String> getDescription(); @Override boolean test(final Wrapper<?> item);  }
@Test void negatingTrue() { final MarketplaceFilterCondition c = MarketplaceFilterCondition.alwaysAccepting(); final NegatingCondition nc = new NegatingCondition(c); assertThat(nc.test(Wrapper.wrap(new LoanDescriptor(MockLoanBuilder.fresh()), FOLIO))).isFalse(); }
@Test void negatingFalse() { final MarketplaceFilterCondition c = MarketplaceFilterCondition.neverAccepting(); final NegatingCondition nc = new NegatingCondition(c); assertThat(nc.test(Wrapper.wrap(new LoanDescriptor(MockLoanBuilder.fresh()), FOLIO))).isTrue(); }