code: public static HttpBuilder configure(final Function<HttpObjectConfig, ? extends HttpBuilder> factory, @DelegatesTo(HttpObjectConfig.class) final Closure closure) {
          HttpObjectConfig impl = new HttpObjectConfigImpl();
          closure.setDelegate(impl);
          closure.setResolveStrategy(Closure.DELEGATE_FIRST);
          closure.call();
          return factory.apply(impl);
      }
docs: Creates an `HttpBuilder` configured with the provided configuration closure, using the `defaultFactory` as the client factory.
  
  The configuration closure delegates to the {@link HttpObjectConfig} interface, which is an extension of the {@link HttpConfig} interface -
  configuration properties from either may be applied to the global client configuration here. See the documentation for those interfaces for
  configuration property details.
  
  [source,groovy]
  ----
  def factory = { c -> new ApacheHttpBuilder(c); } as Function
  
  def http = HttpBuilder.configure(factory){
  request.uri = 'http://localhost:10101'
  }
  ----
  
  @param factory the {@link HttpObjectConfig} factory function ({@link JavaHttpBuilder} or {@link groovyx.net.http.ApacheHttpBuilder})
  @param closure the configuration closure (delegated to {@link HttpObjectConfig})
  @return the configured `HttpBuilder`