public static <T> Consumer<T> doIf(final boolean condition, final Consumer<T> trueFunction) {
        return doIf(condition, trueFunction, __ -> {
        });
    }
Do if condition holds.

@param <T>          the type parameter
@param condition    the condition
@param trueFunction the true function
@return the consumer
core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/function/FunctionUtils.java