code: public static <T extends Throwable> void checked(boolean predicate,
                                                     String explanation,
                                                     Function<String, T> exceptionFactory) throws T {
      assert explanation != null: "explanation != null";
      assert exceptionFactory != null: "exceptionFactory != null";
  
      if (!predicate) {
        throw exceptionFactory.apply(explain(explanation));
      }
    }
docs: Usage: {@code Ensure.checked(connection != null, "connection != null", IOException::new);}
  
  The throwable type must have a constructor checked just takes a String.
  
  @param predicate the condition
  @param explanation failure reason
  @param exceptionFactory source of error
  @param <T> the type to throw
  @throws T if predicate is false