code: public static HttpBuilder configure(final Function<HttpObjectConfig, ? extends HttpBuilder> factory, final Consumer<HttpObjectConfig> configuration) {
          HttpObjectConfig impl = new HttpObjectConfigImpl();
          configuration.accept(impl);
          return factory.apply(impl);
      }
docs: Creates an `HttpBuilder` using the provided client factory function, configured with the provided configuration function.
  
  The configuration {@link Consumer} function accepts an instance of 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.
  
  This configuration method is generally meant for use with standard Java.
  
  [source,java]
  ----
  HttpBuilder.configure(JavaHttpBuilder::new, new Consumer<HttpObjectConfig>() {
  public void accept(HttpObjectConfig config) {
  config.getRequest().setUri("http://localhost:10101");
  }
  });
  ----
  
  Or, using lambda expressions:
  
  [source,java]
  ----
  HttpBuilder.configure(JavaHttpBuilder::new, config -> {
  config.getRequest().setUri("http://localhost:10101");
  });
  ----
  
  @param factory the {@link HttpObjectConfig} factory function ({@link JavaHttpBuilder} or {@link groovyx.net.http.optional.ApacheHttpBuilder})
  @param configuration the configuration function (accepting {@link HttpObjectConfig})
  @return the configured `HttpBuilder`