### Question:
AwsXRayIdsGenerator implements IdsGenerator { @Override public String generateTraceId() { Random random = ThreadLocalRandom.current(); long timestampSecs = TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis()); long hiRandom = random.nextInt() & 0xFFFFFFFFL; long lowRandom = random.nextLong(); return TraceId.fromLongs(timestampSecs << 32 | hiRandom, lowRandom); }  @Override String generateSpanId(); @Override String generateTraceId();  }### Answer:
@Test void shouldGenerateTraceIdsWithTimestampsWithAllowedXrayTimeRange() { AwsXRayIdsGenerator generator = new AwsXRayIdsGenerator(); for (int i = 0; i < 1000; i++) { String traceId = generator.generateTraceId(); long unixSeconds = Long.valueOf(traceId.subSequence(0, 8).toString(), 16); long ts = unixSeconds * 1000L; long currentTs = System.currentTimeMillis(); assertThat(ts).isLessThanOrEqualTo(currentTs); long month = 86400000L * 30L; assertThat(ts).isGreaterThan(currentTs - month); } }