code: @Beta
      public static <T, E extends Throwable> T check(T reference, Predicate<T> predicate,
                                                     Class<E> throwableType,
                                                     @Nullable String errorMessageTemplate,
                                                     @Nullable Object... errorMessageArgs) throws E {
          checkArgument(reference != null, "Expected non-null reference");
          checkArgument(predicate != null, "Expected non-null predicate");
          checkArgument(throwableType != null, "Expected non-null throwableType");
          check(reference, predicate, (Supplier<E>) () -> throwable(
                  throwableType, parameters(String.class),
                  arguments(messageFromNullable(errorMessageTemplate, errorMessageArgs)))
          );
          return reference;
      }
docs: Performs check with the predicate.
  
  @param reference            reference to check
  @param predicate            the predicate to use
  @param throwableType        the throwable type to throw
  @param errorMessageTemplate a template for the exception message should the
  check fail. The message is formed by replacing each {@code %s}
  placeholder in the template with an argument. These are matched by
  position - the first {@code %s} gets {@code errorMessageArgs[0]}, etc.
  Unmatched arguments will be appended to the formatted message in square
  braces. Unmatched placeholders will be left as-is.
  @param errorMessageArgs     the arguments to be substituted into the message
  template. Arguments are converted to strings using
  {@link String#valueOf(Object)}.
  @param <T>                  the reference type
  @param <E>                  the exception type
  @return the original reference
  @throws IllegalArgumentException if the {@code reference}, {@code predicate} or {@code throwableType} is null
  @throws IllegalArgumentException if the {@code throwableType} cannot be instantiated
  @throws E                        if the {@code reference} doesn't match provided predicate