@Test
public void testExtract() throws Exception {

    SofaTracerSpanContext spanContext = SofaTracerSpanContext.rootStart();
    Map<String, String> baggage = new HashMap<>();
    baggage.put("key", "value");
    baggage.put("key1", "value1");
    baggage.put("key2", "value2");
    spanContext.addBizBaggage(baggage);
    //inject
    //200 bytes
    ByteBuffer carrier = ByteBuffer.allocate(400);
    this.registryExtractorInjector.inject(spanContext, carrier);
    //extract
    SofaTracerSpanContext extractContext = this.registryExtractorInjector.extract(carrier);
    //traceid spanId sampled
    extractContext.equals(spanContext);
    assertTrue("Extract baggage : " + extractContext.getBizBaggage(),
        baggage.equals(extractContext.getBizBaggage()));
}