Conditions { @NonNull public static <T> Condition predicateAsCondition(@NonNull final Predicate<T> predicate, @NonNull final Supplier<? extends T> supplier) { if (predicate == TRUE_CONDICATE) { return TRUE_CONDICATE; } if (predicate == FALSE_CONDICATE) { return FALSE_CONDICATE; } return new PredicateCondition<>(predicate, supplier); } private  Conditions(); @NonNull static Condition trueCondition(); @NonNull static Condition falseCondition(); @NonNull static Condition staticCondition(final boolean value); @NonNull static Condition not(@NonNull final Condition condition); @NonNull static Condition any(@NonNull final Condition... conditions); @NonNull static Condition all(@NonNull final Condition... conditions); @NonNull static Condition predicateAsCondition(@NonNull final Predicate<T> predicate,
      @NonNull final Supplier<? extends T> supplier);  }
@Test public void shouldPassSupplierObjectToPredicateForTruePredicateAsCondition() { assertThat(predicateAsCondition(mockPredicateTrue, mockValueSupplier), applies()); }
@Test public void shouldPassSupplierObjectToPredicateForFalsePredicateAsCondition() { assertThat(predicateAsCondition(mockPredicateFalse, mockValueSupplier), doesNotApply()); verify(mockPredicateFalse).apply(VALUE); }