class Tracer {

  public final Span joinSpan(TraceContext context) {
    if (context == null) throw new NullPointerException("context == null");
    if (!supportsJoin) return newChild(context);

    // set shared flag if not already done
    int flags = InternalPropagation.instance.flags(context);
    if (!context.shared()) {
      flags |= FLAG_SHARED;
      return toSpan(context, InternalPropagation.instance.withFlags(context, flags));
    } else {
      flags &= ~FLAG_SHARED;
      return toSpan(InternalPropagation.instance.withFlags(context, flags), context);
    }
  }

    Tracer(
    Clock clock,
    Propagation.Factory propagationFactory,
    SpanHandler spanHandler,
    PendingSpans pendingSpans,
    Sampler sampler,
    CurrentTraceContext currentTraceContext,
    boolean traceId128Bit,
    boolean supportsJoin,
    boolean alwaysSampleLocal,
    AtomicBoolean noop
  );

}