title: How to stop resource leak at HttpClient?
body: <p>I have some code to download a file utilizing <code>org.apache.http.client.HttpClient</code>. Now my IDE tells me that I have a <code>Potential resource leak: 'client' may not be closed</code>. The concrete code is:</p>
  
  <pre><code>HttpClient client = HttpClientBuilder.create().build();
  
  HttpResponse response = client.execute(request);
  
  HttpEntity entity = response.getEntity();
  </code></pre>
  
  <p>I did some research and found <code>EntityUtils.consume(entity);</code>, but this doesn't solve the resource leak for <code>client</code>. </p>
  
  <p>So my question is, is this really a resource leak and if yes, how do I close it properly? </p>