InternalPropagation { public static int sampled(boolean sampled, int flags) { if (sampled) { flags |= FLAG_SAMPLED | FLAG_SAMPLED_SET; } else { flags |= FLAG_SAMPLED_SET; flags &= ~FLAG_SAMPLED; } return flags; }  abstract int flags(SamplingFlags flags); static int sampled(boolean sampled, int flags); abstract TraceContext newTraceContext(
    int flags,
    long traceIdHigh,
    long traceId,
    long localRootId,
    long parentId,
    long spanId,
    List<Object> extra
  ); abstract TraceContext shallowCopy(TraceContext context); abstract TraceContext withExtra(TraceContext context, List<Object> immutableExtra); abstract TraceContext withFlags(TraceContext context, int flags); static final int FLAG_SAMPLED; static final int FLAG_SAMPLED_SET; static final int FLAG_DEBUG; static final int FLAG_SHARED; static final int FLAG_SAMPLED_LOCAL; static final int FLAG_LOCAL_ROOT; static InternalPropagation instance; }
@Test public void set_sampled_true() { assertThat(sampled(true, 0)) .isEqualTo(FLAG_SAMPLED_SET + FLAG_SAMPLED); }
@Test public void set_sampled_false() { assertThat(sampled(false, FLAG_SAMPLED_SET | FLAG_SAMPLED)) .isEqualTo(FLAG_SAMPLED_SET); }