BaggageFields { public static BaggageField constant(String name, @Nullable String value) { return new BaggageField(name, new Constant(value)); }  static BaggageField constant(String name, @Nullable String value); static final BaggageField TRACE_ID; static final BaggageField PARENT_ID; static final BaggageField SPAN_ID; static final BaggageField SAMPLED; }
@Test public void constant() { BaggageField constant = BaggageFields.constant("foo", "bar"); assertThat(constant.getValue(context)).isEqualTo("bar"); assertThat(constant.getValue(extracted)).isEqualTo("bar"); BaggageField constantNull = BaggageFields.constant("foo", null); assertThat(constantNull.getValue(context)).isNull(); assertThat(constantNull.getValue(extracted)).isNull(); }