private void injectValues(Object target, boolean sharedFields, Specification specInstance) throws IllegalAccessException {
    for (InjectionPoint point : injectionPoints) {
      if (!(point.getMember() instanceof Field))
        throw new GuiceExtensionException("Method injection is not supported; use field injection instead");

      Field field = (Field)point.getMember();
      if (field.isAnnotationPresent(Shared.class) != sharedFields) continue;

      Object value = injector.getInstance(point.getDependencies().get(0).getKey());
      if (MOCK_UTIL.isMock(value)) {
        MOCK_UTIL.attachMock(value, specInstance);
      }
      field.setAccessible(true);
      field.set(target, value);
    }
  }
Creates a Guice injector, and injects Guice-provided objects into specifications.

@author Peter Niederwieser
spock-guice/src/main/java/org/spockframework/guice/GuiceInterceptor.java