public static <T> T executeGroovyScript(final GroovyObject groovyObject,
                                            final Object[] args, final Class<T> clazz,
                                            final boolean failOnError) throws Throwable {
        return executeGroovyScript(groovyObject, "run", args, clazz, failOnError);
    }
Execute groovy script.

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