Tracer { public ScopedSpan startScopedSpanWithParent(String name, @Nullable TraceContext parent) { if (name == null) throw new NullPointerException("name == null"); TraceContext context = parent != null ? decorateContext(parent, parent.spanId()) : newRootContext(0); return newScopedSpan(parent, context, name); } Tracer(
    Clock clock,
    Propagation.Factory propagationFactory,
    SpanHandler spanHandler,
    PendingSpans pendingSpans,
    Sampler sampler,
    CurrentTraceContext currentTraceContext,
    boolean traceId128Bit,
    boolean supportsJoin,
    boolean alwaysSampleLocal,
    AtomicBoolean noop
  ); @Deprecated Tracer withSampler(Sampler sampler); Span newTrace(); final Span joinSpan(TraceContext context); Span newChild(TraceContext parent); Span nextSpan(TraceContextOrSamplingFlags extracted); Span toSpan(TraceContext context); SpanInScope withSpanInScope(@Nullable Span span); SpanCustomizer currentSpanCustomizer(); @Nullable Span currentSpan(); Span nextSpan(); ScopedSpan startScopedSpan(String name); ScopedSpan startScopedSpan(String name, SamplerFunction<T> samplerFunction, T arg); Span nextSpan(SamplerFunction<T> samplerFunction, T arg); Span nextSpanWithParent(SamplerFunction<T> samplerFunction, T arg,
    @Nullable TraceContext parent); ScopedSpan startScopedSpanWithParent(String name, @Nullable TraceContext parent); @Override String toString();  }
@Test public void startScopedSpanWithParent_resultantSpanIsLocalRoot() { ScopedSpan span = tracer.startScopedSpanWithParent("foo", context); try { assertThat(span.context().spanId()).isEqualTo(span.context().localRootId()); assertThat(span.context().isLocalRoot()).isTrue(); ScopedSpan child = tracer.startScopedSpanWithParent("bar", span.context()); try { assertThat(child.context().localRootId()).isEqualTo(span.context().localRootId()); assertThat(child.context().isLocalRoot()).isFalse(); } finally { child.finish(); } } finally { span.finish(); } }