@Test
public void testSpansClosedInIncorrectOrderClearsContextButDoesNotLogUnclosedSpans() {

    final SpanSink sink = mock(SpanSink.class);
    SpanSinkRegistry.register(sink);
    Span trace = SpanHelper.startTrace("The Trace");
    // These are deliberately not closed
    SpanHelper.startSpan("one");
    SpanHelper.startSpan("two");
    trace.end();
    assertTrue(SpanHelper.captureSpans().isEmpty());
    verify(sink).record(trace);
    verifyZeroInteractions(sink);
}