@Test
public void testCommandFailed() {

  commandListener.commandStarted(findStartEvent);
  StartSpanEvent startEvent = tracer.startSpanEvents.get(0);
  tracer.reset();
  commandListener.commandFailed(findFailedEvent);
  assertThat(tracer.endSpanEvents).hasSize(1);
  EndSpanEvent endSpanEvent = tracer.endSpanEvents.get(0);
  assertThat(endSpanEvent.getTraceContext()).isEqualTo(startEvent.getTraceContext());
  assertThat(endSpanEvent.getEndSpanOptions()).isNull();
  assertThat(tracer.annotateEvents).hasSize(1);
  AnnotateEvent annotateEvent = tracer.annotateEvents.get(0);
  assertThat(annotateEvent.getTraceContext()).isEqualTo(endSpanEvent.getTraceContext());
  assertThat(annotateEvent.getLabels().getLabels()).containsAllOf(
      new Label("/mongodb/status", "FAILURE"),
      new Label("/mongodb/error", "Error!")
  );
}