@SuppressWarnings("unchecked")
  public static <T> T coerce(Object obj, Class<T> type) {
    // can't use `type.cast()` because it will fail if `type` is a primitive type
    return (T) DefaultTypeTransformation.castToType(obj, type);
  }
Provides convenient access to Groovy language and runtime features.
By convention, all usages of Groovy's InvokerHelper and
ScriptBytecodeAdapter go through this class.

@author Peter Niederwieser
spock-core/src/main/java/org/spockframework/runtime/GroovyRuntimeUtil.java