public <T> T makeMockInternal(IMockCreationSettings settings, BiFunction<IMockMaker, IMockCreationSettings, T> code) throws CannotCreateMockException {
    IMockMakerSettings mockMakerSettings = settings.getMockMakerSettings();
    if (mockMakerSettings != null) {
      MockMakerId mockMakerId = mockMakerSettings.getMockMakerId();
      IMockMaker mockMaker = makerMap.get(mockMakerId);
      if (mockMaker == null) {
        throw new CannotCreateMockException(settings.getMockType(), " because MockMaker with ID '" + mockMakerId + "' does not exist.");
      }
      verifyIsMockable(mockMaker, settings);
      return code.apply(mockMaker, settings);
    }
    return createWithAppropriateMockMaker(settings, code);
  }
Mocks the static methods of the type provided by the {@code settings}.

@param settings the mock settings
@return the {@link IStaticMock} object representing the static mocked class
@throws CannotCreateMockException if a mock with the provided settings can't be created.
spock-core/src/main/java/org/spockframework/mock/runtime/MockMakerRegistry.java