@Test public void annotations() {

  MutableSpan span = new MutableSpan();
  assertThat(span.annotationCount()).isZero();
  assertThat(span.annotations()).isEmpty();
  span.annotate(1L, "1");
  assertThat(span.annotationCount()).isOne();
  assertThat(span.annotations()).containsExactly(
      entry(1L, "1")
  );
  span.annotate(2L, "2");
  assertThat(span.annotationCount()).isEqualTo(2);
  assertThat(span.annotations()).containsExactly(
      entry(1L, "1"),
      entry(2L, "2")
  );
  span.forEachAnnotation((t, v) -> v.equals("1") ? v : null);
  assertThat(span.annotationCount()).isOne();
  assertThat(span.annotations()).containsExactly(
      entry(1L, "1")
  );
}