public static Builder newBuilder(PinotConfiguration pinotConfiguration) {
    Builder builder = new Builder();
    String maxConns = pinotConfiguration.getProperty(MAX_CONNS_CONFIG_NAME);
    if (StringUtils.isNotEmpty(maxConns)) {
      builder.withMaxConns(Integer.parseInt(maxConns));
    }
    String maxConnsPerRoute = pinotConfiguration.getProperty(MAX_CONNS_PER_ROUTE_CONFIG_NAME);
    if (StringUtils.isNotEmpty(maxConnsPerRoute)) {
      builder.withMaxConnsPerRoute(Integer.parseInt(maxConnsPerRoute));
    }
    boolean disableDefaultUserAgent = pinotConfiguration.getProperty(DISABLE_DEFAULT_USER_AGENT_CONFIG_NAME, false);
    builder.withDisableDefaultUserAgent(disableDefaultUserAgent);
    return builder;
  }
@Test
  public void testNewBuilder() {
    // Ensure config values are picked up by the builder.
    PinotConfiguration pinotConfiguration = new PinotConfiguration();
    pinotConfiguration.setProperty(HttpClientConfig.MAX_CONNS_CONFIG_NAME, "123");
    pinotConfiguration.setProperty(HttpClientConfig.MAX_CONNS_PER_ROUTE_CONFIG_NAME, "11");
    pinotConfiguration.setProperty(HttpClientConfig.DISABLE_DEFAULT_USER_AGENT_CONFIG_NAME, "true");
    HttpClientConfig httpClientConfig = HttpClientConfig.newBuilder(pinotConfiguration).build();
    Assert.assertEquals(123, httpClientConfig.getMaxConnTotal());
    Assert.assertEquals(11, httpClientConfig.getMaxConnPerRoute());
    Assert.assertTrue(httpClientConfig.isDisableDefaultUserAgent());

    // Ensure default builder uses negative values
    HttpClientConfig defaultConfig = HttpClientConfig.newBuilder(new PinotConfiguration()).build();
    Assert.assertTrue(defaultConfig.getMaxConnTotal() < 0, "default value should be < 0");
    Assert.assertTrue(defaultConfig.getMaxConnPerRoute() < 0, "default value should be < 0");
    Assert.assertFalse(defaultConfig.isDisableDefaultUserAgent(), "Default user agent should be enabled by default");
  }