public static <T> Consumer<T> doIf(final boolean condition, final Consumer<T> trueFunction,
                                       final Consumer<T> falseFunction) {
        return account -> {
            if (condition) {
                trueFunction.accept(account);
            } else {
                falseFunction.accept(account);
            }
        };
    }
Do if consumer.

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