@Test public void toSamplingFlags_returnsConstantsAndHasNiceToString() {

  assertThat(toSamplingFlags(SamplingFlags.EMPTY.flags))
    .isSameAs(SamplingFlags.EMPTY)
    .hasToString("");
  assertThat(toSamplingFlags(SamplingFlags.NOT_SAMPLED.flags))
    .isSameAs(SamplingFlags.NOT_SAMPLED)
    .hasToString("NOT_SAMPLED_REMOTE");
  assertThat(toSamplingFlags(SamplingFlags.SAMPLED.flags))
    .isSameAs(SamplingFlags.SAMPLED)
    .hasToString("SAMPLED_REMOTE");
  assertThat(toSamplingFlags(SamplingFlags.DEBUG.flags))
    .isSameAs(SamplingFlags.DEBUG)
    .hasToString("DEBUG");
  assertThat(toSamplingFlags(SamplingFlags.EMPTY.flags | FLAG_SAMPLED_LOCAL))
    .isSameAs(SamplingFlags.EMPTY_SAMPLED_LOCAL)
    .hasToString("SAMPLED_LOCAL");
  assertThat(toSamplingFlags(SamplingFlags.NOT_SAMPLED.flags | FLAG_SAMPLED_LOCAL))
    .isSameAs(SamplingFlags.NOT_SAMPLED_SAMPLED_LOCAL)
    .hasToString("NOT_SAMPLED_REMOTE|SAMPLED_LOCAL");
  assertThat(toSamplingFlags(SamplingFlags.SAMPLED.flags | FLAG_SAMPLED_LOCAL))
    .isSameAs(SamplingFlags.SAMPLED_SAMPLED_LOCAL)
    .hasToString("SAMPLED_REMOTE|SAMPLED_LOCAL");
  assertThat(toSamplingFlags(SamplingFlags.DEBUG.flags | FLAG_SAMPLED_LOCAL))
    .isSameAs(SamplingFlags.DEBUG_SAMPLED_LOCAL)
    .hasToString("DEBUG|SAMPLED_LOCAL");
}