private Object createMockImpl(String inferredName, Class<?> inferredType, Object instance, MockNature nature,
MockImplementation implementation, Map<String, Object> options, Class<?> specifiedType, Closure closure) {
Type effectiveType = specifiedType != null ? specifiedType : options.containsKey("type") ? (Type) options.get("type") : inferredType;
if (effectiveType == null) {
throw new InvalidSpecException("Mock object type cannot be inferred automatically. " +
"Please specify a type explicitly (e.g. 'Mock(Person)').");
}
return createMock(inferredName, instance, effectiveType, nature, implementation, options, closure);
}
}