code: public static <T> T checkInvariant(
      final T value,
      final Predicate<T> predicate,
      final Function<T, String> describer)
    {
      final boolean ok;
      try {
        ok = predicate.test(value);
      } catch (final Throwable e) {
        final Violations violations = singleViolation(failedPredicate(e));
        throw new InvariantViolationException(
          failedMessage(value, violations), e, violations.count());
      }
  
      return innerCheckInvariant(value, ok, describer);
    }
docs: <p>Evaluate the given {@code predicate} using {@code value} as input.</p>
  
  <p>The function throws {@link InvariantViolationException} if the predicate
  is false.</p>
  
  @param value     The value
  @param predicate The predicate
  @param describer A describer for the predicate
  @param <T>       The type of values
  
  @return value
  
  @throws InvariantViolationException If the predicate is false