@Test
public void testSubmitsExpectedRecordTasksToExecutor() {

    ExecutorService executor = mock(ExecutorService.class);
    AsynchronousSpanSink.JobFactory jobFactory = mock(AsynchronousSpanSink.JobFactory.class);
    SpanSink sink = new AsynchronousSpanSink(executor, jobFactory);
    SpanData spanData = new BeanSpanData();
    Runnable runnable = new Runnable() {
        @Override
        public void run() {
        }
    };
    when(jobFactory.createJob(eq(spanData))).thenReturn(runnable);
    sink.record(spanData);
    verify(jobFactory).createJob(eq(spanData));
    verify(executor).execute(eq(runnable));
}