* @param proxyPort the port to use for the proxy host. If {@code null}, this will use the default HTTP port.
*
* @return the Client that was created.
*/
private static Client createClient(@Nullable final String proxyHost, @Nullable final Integer proxyPort) {
final ClientConfig clientConfig = new DefaultClientConfig();
clientConfig.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING, Boolean.TRUE);
clientConfig.getClasses().add(JacksonObjectMapperProvider.class);
if (StringUtils.isNotEmpty(proxyHost)) {
Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxyHost, proxyPort == null ? 443 : proxyPort));
return new Client(new URLConnectionClientHandler(new ProxyHandler(proxy)), clientConfig);
}