public static <R> Supplier<R> doIfNotNull(final Object input,
                                              final CheckedSupplier<R> trueFunction,
                                              final Supplier<R> falseFunction) {
        return () -> {
            try {
                if (input != null) {
                    return trueFunction.get();
                }
                return falseFunction.get();
            } catch (final Throwable e) {
                LoggingUtils.warn(LOGGER, e);
                return falseFunction.get();
            }
        };
    }
Supply if not null supplier.

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