### Question:
TraceeHttpClientDecorator extends HttpClient { public static HttpClient wrap(HttpClient httpClient) { return wrap(httpClient, DEFAULT); } TraceeHttpClientDecorator(HttpClient delegate, TraceeBackend backend, HttpHeaderTransport transportSerialization, String profile);   TraceeHttpClientDecorator(HttpClient delegate, TraceeBackend backend, String profile);  TraceeHttpClientDecorator(HttpClient delegate, String profile); static HttpClient wrap(HttpClient httpClient); static HttpClient wrap(HttpClient httpClient, String profile); @Override int executeMethod(HttpMethod method); @Override int executeMethod(HostConfiguration hostConfiguration, HttpMethod method); @Override int executeMethod(HostConfiguration hostconfig, HttpMethod method, HttpState state); @Override synchronized HttpState getState(); @Override synchronized void setState(HttpState state); @Override @SuppressWarnings("deprecation") synchronized void setStrictMode(boolean strictMode); @Override @SuppressWarnings("deprecation") synchronized boolean isStrictMode(); @Override @SuppressWarnings("deprecation") synchronized void setTimeout(int newTimeoutInMilliseconds); @Override @SuppressWarnings("deprecation") synchronized void setHttpConnectionFactoryTimeout(long timeout); @Override @SuppressWarnings("deprecation") synchronized void setConnectionTimeout(int newTimeoutInMilliseconds); @Override @SuppressWarnings("deprecation") String getHost(); @Override @SuppressWarnings("deprecation") int getPort(); @Override synchronized HostConfiguration getHostConfiguration(); @Override synchronized void setHostConfiguration(HostConfiguration hostConfiguration); @Override synchronized HttpConnectionManager getHttpConnectionManager(); @Override synchronized void setHttpConnectionManager(HttpConnectionManager httpConnectionManager); @Override HttpClientParams getParams(); @Override void setParams(HttpClientParams params);  }### Answer:
@Test public void shouldDelegateAllPublicMethods() { final HttpClient client = mock(HttpClient.class); final HttpClient wrappedClient = TraceeHttpClientDecorator.wrap(client); assertDelegationToSpy(client).by(wrappedClient).ignore("executeMethod").verify(); }
@Test public void wrapOnlyWithTraceeHttpClientDecoratorIfInstanceIsNotOfThisType() { final HttpClient httpClient = TraceeHttpClientDecorator.wrap(mock(HttpClient.class)); final HttpClient wrappedAgainHttpClient = TraceeHttpClientDecorator.wrap(httpClient); assertThat(httpClient, is(sameInstance(wrappedAgainHttpClient))); }