private void runBeforeRegistryCreatedMethods(Specification spec) {
    Object returnValue;

    for (Method method : findAllBeforeRegistryCreatedMethods()) {
      returnValue = ReflectionUtil.invokeMethod(spec, method);

      // Return values of a type other than Registry are silently ignored.
      // This avoids problems in case the method unintentionally returns a
      // value (which is common due to Groovy's implicit return).
      if (returnValue instanceof Registry)
        registry = (Registry) returnValue;
    }
  }
Controls creation, startup and shutdown of the Tapestry container,
and injects specifications with Tapestry-provided objects.

@author Peter Niederwieser
spock-tapestry/src/main/java/org/spockframework/tapestry/TapestryInterceptor.java