@Test public void startScopedSpan_resultantSpanIsLocalRoot() {

  ScopedSpan span = tracer.startScopedSpan("foo");
  try {
    assertThat(span.context().spanId()).isEqualTo(span.context().localRootId()); // Sanity check
    assertThat(span.context().isLocalRoot()).isTrue();
    ScopedSpan child = tracer.startScopedSpan("bar");
    try {
      // Check we don't always make children local roots
      assertThat(child.context().localRootId()).isEqualTo(span.context().localRootId());
      assertThat(child.context().isLocalRoot()).isFalse();
    } finally {
      child.finish();
    }
  } finally {
    span.finish();
  }
}