@SuppressWarnings("deprecation")
  private static SpanContext fromSleuthSpan(org.springframework.cloud.sleuth.Span span) {
    return SpanContext.create(
        TraceId.fromBytes(
            ByteBuffer.allocate(TraceId.SIZE)
                .putLong(span.getTraceIdHigh())
                .putLong(span.getTraceId())
                .array()),
        SpanId.fromBytes(ByteBuffer.allocate(SpanId.SIZE).putLong(span.getSpanId()).array()),
        Boolean.TRUE.equals(span.isExportable()) ? sampledOptions : notSampledOptions);
  }
@ SuppressWarnings ( "deprecation" ) private static SpanContext fromSleuthSpan ( org . springframework . cloud . sleuth . Span span ) { return SpanContext . create ( TraceId . fromBytes ( ByteBuffer . allocate ( TraceId . SIZE ) . putLong ( span . getTraceIdHigh ( ) ) . putLong ( span . getTraceId ( ) ) . array ( ) ) , SpanId . fromBytes ( ByteBuffer . allocate ( SpanId . SIZE ) . putLong ( span . getSpanId ( ) ) . array ( ) ) , Boolean . TRUE . equals ( span . isExportable ( ) ) ? sampledOptions : notSampledOptions ) ; }
TODO: upgrade to new SpanContext.create() once it has been released.