private Object createDummy(IMockInvocation invocation) {
    Class<?> type = invocation.getMethod().getReturnType();
    Type genericType = invocation.getMethod().getExactReturnType();
    Specification spec = invocation.getMockObject().getSpecification();
    return spec.createMock("dummy", genericType, MockNature.STUB, GroovyObject.class.isAssignableFrom(type) ?
        MockImplementation.GROOVY : MockImplementation.JAVA, emptyMap(), null);
  }
A response strategy that returns zero, an "empty" object, or a "dummy" object,
depending on the method's declared return type.
spock-core/src/main/java/org/spockframework/mock/EmptyOrDummyResponse.java