private static ApacheHttpClient4 createDefaultJerseyClient(HttpClientConfiguration configuration) {
HttpClient httpClient = new HttpClientBuilder().using(configuration).build();
ApacheHttpClient4Handler handler = new ApacheHttpClient4Handler(httpClient, null, true);
ApacheHttpClient4Config config = new DefaultApacheHttpClient4Config();
config.getSingletons().add(new JacksonMessageBodyProvider(new ObjectMapperFactory().build(), new Validator()));
return new ApacheHttpClient4(handler, config);
}