@Test
public void testCloneInstance() {

    SofaTracerSpan span = (SofaTracerSpan) this.sofaTracer.buildSpan("testCloneInstance")
        .start();
    span.setParentSofaTracerSpan(this.sofaTracerSpan);
    SofaTracerSpanContext spanContext = span.getSofaTracerSpanContext();
    SofaTracerSpan cloneSpan = span.cloneInstance();
    SofaTracerSpanContext cloneSpanContext = cloneSpan.getSofaTracerSpanContext();
    assertEquals(spanContext, cloneSpanContext);
    assertEquals(spanContext.getBizBaggage(), cloneSpanContext.getBizBaggage());
    assertEquals(spanContext.isSampled(), cloneSpanContext.isSampled());
    assertSame(spanContext.getChildContextIndex(), cloneSpanContext.getChildContextIndex());
    assertEquals(span.getTagsWithStr(), cloneSpan.getTagsWithStr());
    assertEquals(span.getTagsWithNumber(), cloneSpan.getTagsWithNumber());
    assertEquals(span.getTagsWithBool(), cloneSpan.getTagsWithBool());
    assertEquals(span.getStartTime(), cloneSpan.getStartTime());
    assertEquals(span.getEndTime(), cloneSpan.getEndTime());
    assertEquals(span.getLogs(), cloneSpan.getLogs());
    assertEquals(span.getLogType(), cloneSpan.getLogType());
    assertEquals(span.getOperationName(), cloneSpan.getOperationName());
    assertSame(span.getParentSofaTracerSpan(), cloneSpan.getParentSofaTracerSpan());
}