SamplingFlags { public final boolean debug() { return debug(flags); } SamplingFlags(int flags); @Nullable final Boolean sampled(); final boolean sampledLocal(); final boolean debug(); @Override String toString(); static final SamplingFlags EMPTY; static final SamplingFlags NOT_SAMPLED; static final SamplingFlags SAMPLED; static final SamplingFlags DEBUG; }
@Test public void debug_set_true() { assertThat(SamplingFlags.debug(true, SamplingFlags.EMPTY.flags)) .isEqualTo(SamplingFlags.DEBUG.flags) .isEqualTo(FLAG_SAMPLED_SET | FLAG_SAMPLED | FLAG_DEBUG); }
@Test public void sampled_flags() { assertThat(SamplingFlags.debug(false, SamplingFlags.DEBUG.flags)) .isEqualTo(SamplingFlags.SAMPLED.flags) .isEqualTo(FLAG_SAMPLED_SET | FLAG_SAMPLED); }