@Test public void nextSpan_fromContext_resultantSpanIsLocalRoot() {

  TraceContext context = TraceContext.newBuilder().traceId(1).spanId(2).build();
  Span span = tracer.nextSpan(TraceContextOrSamplingFlags.create(context));
  assertThat(span.context().spanId()).isEqualTo(span.context().localRootId()); // Sanity check
  assertThat(span.context().isLocalRoot()).isTrue();
  // Bad behaviour, but if someone uses extract in the same process, it isn't a local root
  Span child = tracer.nextSpan(TraceContextOrSamplingFlags.create(span.context()));
  assertThat(child.context().localRootId()).isEqualTo(span.context().localRootId());
  assertThat(child.context().isLocalRoot()).isFalse();
}