Q:

ClientBuilder newBuilder() vs newClient()

Regarding javax.ws.rs.client.ClientBuilder, I have read both the JavaDoc and the Jersey Documentation, but still it is not obvious to me when we should use newClient() and when we should use newBuilder()
I do notice that newClient() allows us to pass in a ClientConfig, and newBuilder() allows us to set sslContext().  What if we need to do both? 
Can anyone give me a quick summary on the two concepts?

A:

newClient is just a shortcut to bypass the builder when you only have a Configuration to pass in. If you need to set up both, you use the newBuilder method, e.g.:
Client client = ClientBuilder.newBuilder()
        .withConfig(config)
        .sslContext(sslContext)
        // Whatever else you set up
        .build()

