@Override
    public Optional<SpanEvent> onNormalSpanStart(TracingRequest tracingRequest) {
        if (!isTracing) {
            return Optional.empty();
        }
        Optional<SpanEvent> spanEventOptional = configureSpanEvent(tracingRequest);
        if (!spanEventOptional.isPresent()) {
            return spanEventOptional;
        }
        SpanEvent spanEvent = spanEventOptional.get();
        return Optional.of(spanEvent);
    }
@Test
    public void onNormalSpanStart() {
        try (MockedStatic<ServiceManager> mockedStatic = Mockito.mockStatic(ServiceManager.class)) {
            mockedStatic.when(() -> ServiceManager.getService(GatewayClient.class))
                    .thenReturn(new NettyGatewayClient());
            TracingServiceImpl tracingService = new TracingServiceImpl();

            // Service is stopped.
            tracingService.stop();
            TracingRequest tracingRequest = new TracingRequest("", "", "", "", "");
            Assert.assertFalse(tracingService.onNormalSpanStart(tracingRequest).isPresent());

            // SpanEventContext is null.
            tracingService.start();
            Assert.assertFalse(tracingService.onNormalSpanStart(tracingRequest).isPresent());

            // The normal condition.
            String traceId = TracingUtils.generateTraceId();
            header.put(TRACE_ID, traceId);
            header.put(PARENT_SPAN_ID, INIT_PARENT_SPAN_ID);
            header.put(SPAN_ID_PREFIX, INIT_SPAN_ID_PREFIX);
            tracingService.onProviderSpanStart(tracingRequest, extractService, header);
            tracingService.onSpanFinally();
            Optional<SpanEvent> spanEventOptional = tracingService.onNormalSpanStart(tracingRequest);
            Assert.assertTrue(spanEventOptional.isPresent());
            Assert.assertEquals(traceId, spanEventOptional.get().getTraceId());
            Assert.assertEquals("0-0-1", spanEventOptional.get().getSpanId());
            Assert.assertEquals(INIT_SPAN_ID, spanEventOptional.get().getParentSpanId());
            tracingService.onSpanFinally();

            // The second children span.
            spanEventOptional = tracingService.onNormalSpanStart(tracingRequest);
            Assert.assertTrue(spanEventOptional.isPresent());
            Assert.assertEquals(traceId, spanEventOptional.get().getTraceId());
            Assert.assertEquals("0-0-2", spanEventOptional.get().getSpanId());
            Assert.assertEquals(INIT_SPAN_ID, spanEventOptional.get().getParentSpanId());
            tracingService.onSpanFinally();
            tracingService.stop();
        }
    }