@Override
    protected String getDestination(Exchange exchange, Endpoint endpoint) {
        // Extract path, and remove leading '/'
        return URI.create(endpoint.getEndpointUri()).getPath().substring(1);
    }
@Test
    public void testGetDestination() {
        Endpoint endpoint = Mockito.mock(Endpoint.class);

        Mockito.when(endpoint.getEndpointUri()).thenReturn("cometd://localhost:8080/service/mychannel");

        AbstractMessagingSpanDecorator decorator = new CometdSpanDecorator();

        assertEquals("service/mychannel", decorator.getDestination(null, endpoint));
    }