### Question:
RestTemplate { public <T> T delete(String path, ResponseCallback<T> callback) { return handleResponse(callback, client.delete(path)); } RestTemplate(HttpClient client); T get(String path, ResponseCallback<T> callback); T getUncached(String path, ResponseCallback<T> callback); HttpResponse get(String path); HttpResponse getUncached(String path); void put(String path); T put(String path, ResponseCallback<T> callback); T put(String path, String content, ResponseCallback<T> callback); T put(String path, HttpEntity httpEntity, ResponseCallback<T> callback); T copy(String path, String destinationUri, ResponseCallback<T> callback); void put(String path, String content); void put(String path, HttpEntity httpEntity); void put(String path, InputStream data, String contentType,
			long contentLength); T put(String path, InputStream data, String contentType,
			long contentLength, ResponseCallback<T> callback); T post(String path, String content, ResponseCallback<T> callback); T post(String path, HttpEntity httpEntity, ResponseCallback<T> callback); T post(String path, InputStream content, ResponseCallback<T> callback); T postUncached(String path, String content, ResponseCallback<T> callback); HttpResponse post(String path, String content ); HttpResponse postUncached(String path, String content ); T delete(String path, ResponseCallback<T> callback); void delete(String path); T head(String path, ResponseCallback<T> callback);  }### Answer:
@Test public void delete_should_release_connection() { RestTemplate template = new RestTemplate(client); HttpResponse rsp = mock(HttpResponse.class); when(client.delete(anyString())).thenReturn(rsp); when(rsp.isSuccessful()).thenReturn(Boolean.TRUE); template.delete("/some/path"); verify(client).delete("/some/path"); verify(rsp).releaseConnection(); }