@Test
public void scheduleRunnable_with_tracerContext() throws Exception {

    SofaTraceContext sofaTraceContext = new SofaTracerThreadLocalTraceContext();
    sofaTraceContext.push(sofaTracerSpan);
    final Map<String, Integer> taskMap = new HashMap<String, Integer>();
    taskMap.put("key", 1);
    SofaTracerRunnable sofaTracerRunnable = new SofaTracerRunnable(new Runnable() {
        @Override
        public void run() {
            taskMap.put("key", taskMap.get("key") + 1);
        }
    }, sofaTraceContext);
    tracerScheduleExecutorService.schedule(sofaTracerRunnable, 1000, TIME_UNIT);
    Thread.sleep(1100);
    Integer result = taskMap.get("key");
    Assert.assertTrue(result == 2);
    //check currentSpan
    Field field = sofaTracerRunnable.getClass().getDeclaredField("traceContext");
    field.setAccessible(true);
    SofaTraceContext resultSofaTraceContext = (SofaTraceContext) field.get(sofaTracerRunnable);
    SofaTracerSpan currentSpan = resultSofaTraceContext.getCurrentSpan();
    Assert.assertTrue(currentSpan.getOperationName().equals("SofaTracerSpanTest"));
}