private void configureExtension(Object extension) {
    Arrays.stream(extension.getClass().getDeclaredFields())
      .filter(field -> !Modifier.isFinal(field.getModifiers()))
      .forEach(field -> {
        ConfigurationObject annotation = field.getType().getAnnotation(ConfigurationObject.class);
        if (annotation != null) {
          injectConfiguration(field, annotation, extension);
        }
      });
  }
Maintains a registry of global Spock extensions and their configuration objects,
which can be used to configure other extensions.

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