private BeanDefinition createBeanDefinition(MockDefinition mockDefinition) {
    RootBeanDefinition definition = new RootBeanDefinition(mockDefinition.getTypeToMock().resolve());
    definition.setTargetType(mockDefinition.getTypeToMock());
    definition.setFactoryBeanName(BEAN_NAME);
    definition.setFactoryMethodName("createMock");
    definition.getConstructorArgumentValues().addIndexedArgumentValue(0, mockDefinition);
    if (mockDefinition.getQualifier() != null) {
      mockDefinition.getQualifier().applyTo(definition);
    }
    return definition;
  }
Create a new {@link SpockMockPostprocessor} instance with the given initial
definitions.

@param definitions the initial definitions
spock-spring/src/main/java/org/spockframework/spring/mock/SpockMockPostprocessor.java