@Test protected void getTraces_filteringMatchesMostRecentTraces(TestInfo testInfo)
    throws Exception {
    String testSuffix = testSuffix(testInfo);
    List<Endpoint> endpoints = IntStream.rangeClosed(1, 10)
      .mapToObj(i -> Endpoint.newBuilder()
        .serviceName(appendSuffix("service" + i, testSuffix))
        .ip("127.0.0.1")
        .build())
      .collect(Collectors.toList());

    long gapBetweenSpans = 100;
    Span[] earlySpans = IntStream.rangeClosed(1, 10).mapToObj(i -> Span.newBuilder().name("early")
      .traceId(newTraceId()).id(Integer.toHexString(i))
      .timestamp((TODAY - i) * 1000L).duration(1L)
      .localEndpoint(endpoints.get(i - 1)).build()).toArray(Span[]::new);

    Span[] lateSpans = IntStream.rangeClosed(1, 10).mapToObj(i -> Span.newBuilder().name("late")
      .traceId(newTraceId()).id(Integer.toHexString(i + 10))
      .timestamp((TODAY + gapBetweenSpans - i) * 1000L).duration(1L)
      .localEndpoint(endpoints.get(i - 1)).build()).toArray(Span[]::new);

    accept(earlySpans);
    accept(lateSpans);

    List<Span>[] earlyTraces =
      Stream.of(earlySpans).map(List::of).toArray(List[]::new);
    List<Span>[] lateTraces =
      Stream.of(lateSpans).map(List::of).toArray(List[]::new);

    assertGetTracesReturnsCount(requestBuilder().build(), 20);

    assertGetTracesReturns(
      requestBuilder().limit(10).build(),
      lateTraces);

    assertGetTracesReturns(
      requestBuilder().endTs(TODAY + gapBetweenSpans).lookback(gapBetweenSpans).build(),
      lateTraces);

    assertGetTracesReturns(
      requestBuilder().endTs(TODAY).build(),
      earlyTraces);
  }
This is unlikely and means instrumentation sends empty spans by mistake.
zipkin-tests/src/main/java/zipkin2/storage/ITSpanStore.java