public static <T> T executeGroovyScript(final Resource groovyScript,
                                            final Object[] args, final Class<T> clazz,
                                            final boolean failOnError) {
        return FunctionUtils.doUnchecked(() -> executeGroovyScript(groovyScript, "run", args, clazz, failOnError));
    }
Execute groovy script via run object.

@param <T>          the type parameter
@param groovyScript the groovy script
@param args         the args
@param clazz        the clazz
@param failOnError  the fail on error
@return the object
core/cas-server-core-scripting/src/main/java/org/apereo/cas/util/scripting/ScriptingUtils.java