public IMockObject asMock(Object object) {
    IMockObject mockOrNull = getMockMakerRegistry().asMockOrNull(object);
    if (mockOrNull == null) {
      throw new IllegalArgumentException("Not a mock object: " + object.toString());
    }
    return mockOrNull;
  }
Returns information about a mock object.

@param object a mock object

@return information about the mock object

@throws IllegalArgumentException if the given object is not a mock object
spock-core/src/main/java/org/spockframework/mock/MockUtil.java