@Test
public void testNextChildContextId() throws Exception {

    SofaTracerSpanContext sofaTracerSpanContext = SofaTracerSpanContext.rootStart();
    String childSpanId = sofaTracerSpanContext.nextChildContextId();
    String childSpanId1 = sofaTracerSpanContext.nextChildContextId();
    String childSpanId2 = sofaTracerSpanContext.nextChildContextId();
    String childSpanId3 = sofaTracerSpanContext.nextChildContextId();
    assertEquals(SofaTracer.ROOT_SPAN_ID, sofaTracerSpanContext.getSpanId());
    //
    assertEquals(2, childSpanId.split("\\.").length);
    assertEquals(2, childSpanId1.split("\\.").length);
    assertEquals(2, childSpanId2.split("\\.").length);
    assertEquals(2, childSpanId3.split("\\.").length);
    String[] childs = childSpanId.split("\\.");
    String[] childs1 = childSpanId1.split("\\.");
    String[] childs2 = childSpanId2.split("\\.");
    String[] childs3 = childSpanId3.split("\\.");
    assertTrue(SofaTracer.ROOT_SPAN_ID.equals(childs[0]));
    assertTrue(SofaTracer.ROOT_SPAN_ID.equals(childs1[0]));
    assertTrue(SofaTracer.ROOT_SPAN_ID.equals(childs2[0]));
    assertTrue(SofaTracer.ROOT_SPAN_ID.equals(childs3[0]));
    //
    assertTrue("Children : " + childs[1] + "," + childs1[1] + "," + childs2[1] + ","
               + childs3[1], sofaTracerSpanContext.lastChildContextId().equals("0.4"));
}