@Test public void join_idempotent_unsampled() {

  TraceContext incoming = TraceContext.newBuilder().traceId(1L).spanId(2L).sampled(false)
    .shared(true).build();
  TraceContext joined = tracer.joinSpan(incoming).context();
  assertThat(joined).isNotSameAs(incoming);
  assertThat(tracer.joinSpan(incoming).context())
    .isNotSameAs(joined); // unsampled spans are by definition not tracked in pending spans
}