@Test public void toSpan_idempotent_unsampled() {

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