@Test
public void testTracingException() {

  final MockSpan span = new MockSpan();
  final Foo delegate = new ThrowingFooImpl();
  final Foo proxy = TracingProxy.instrument(Foo.class, delegate, tracer);
  when(tracer.spanBuilder("ThrowingFooImpl.bar")).thenReturn(spanBuilder);
  when(spanBuilder.startSpan()).thenReturn(span);
  try {
    proxy.bar();
    fail();
  } catch (Exception ignore) {
  }
  verify(tracer).spanBuilder("ThrowingFooImpl.bar");
  verify(spanBuilder).startSpan();
  assertThat(span.ended, is(true));
  assertThat(span.status, is(UNKNOWN));
  assertThat(span.annotations, contains(Annotation.fromDescription("Exception thrown")));
}