public IMockObject asMockOrNull(Object object) {
    if (object instanceof ISpockMockObject) {
      return ((ISpockMockObject) object).$spock_get();
    }
    for (IMockMaker mockMaker : makerList) {
      IMockObject mock = mockMaker.asMockOrNull(object);
      if (mock != null) {
        return mock;
      }
    }
    return null;
  }
Returns information about a mock object, or {@code null} if the object is no mock.

@param object a mock object
@return information about the mock object
spock-core/src/main/java/org/spockframework/mock/runtime/MockMakerRegistry.java