@Test
public void testCallableTraceTokenCopied()
        throws InterruptedException, ExecutionException
{

    AtomicReference<TraceToken> actualToken = new AtomicReference<>();
    CountDownLatch latch = new CountDownLatch(1);
    ExecutorService innerExecutor = newSingleThreadExecutor();
    Object expectedReturn = new Object();
    try {
        createAndRegisterNewRequestToken("somekey", "somevalue");
        TraceToken token = getCurrentTraceToken();
        Future<Object> future = traceTokenCopyingExecutor(innerExecutor).submit(() -> {
            actualToken.set(getCurrentTraceToken());
            latch.countDown();
            return expectedReturn;
        });
        assertTrue(latch.await(10, SECONDS));
        assertEquals(actualToken.get(), token);
        assertEquals(future.get(), expectedReturn);
    }
    finally {
        innerExecutor.shutdown();
    }
}