public static <T> T doAndReturn(final boolean condition, final Supplier<T> trueTask,
                                    final Supplier<T> falseTask) {
        return condition ? trueTask.get() : falseTask.get();
    }
Do and return.

@param <T>       the type parameter
@param condition the condition
@param trueTask  the true task
@param falseTask the false task
@return the ticket
core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/function/FunctionUtils.java