@Test public void trySample_seesUnwrappedValue() {

  AtomicBoolean reachedAssertion = new AtomicBoolean();
  HttpSampler sampler = new HttpSampler() {
    @Override public <Req> Boolean trySample(HttpAdapter<Req, ?> adapter, Req req) {
      assertThat(req).isSameAs(request);
      reachedAssertion.set(true);
      return true;
    }
  };
  when(httpClientRequest.unwrap()).thenReturn(request);
  assertThat(sampler.trySample(httpClientRequest)).isTrue();
  assertThat(reachedAssertion.getAndSet(false)).isTrue();
  when(httpServerRequest.unwrap()).thenReturn(request);
  assertThat(sampler.trySample(httpServerRequest)).isTrue();
  assertThat(reachedAssertion.getAndSet(false)).isTrue();
}