CassandraUtil { static Call.Mapper<Map<String, Long>, Set<String>> traceIdsSortedByDescTimestamp() { return TraceIdsSortedByDescTimestamp.INSTANCE; }  static int durationIndexBucket(long ts_micro);  }
@Test public void traceIdsSortedByDescTimestamp_doesntCollideOnSameTimestamp() { Map<String, Long> input = new LinkedHashMap<>(); input.put("a", 1L); input.put("b", 1L); input.put("c", 2L); Set<String> sortedTraceIds = CassandraUtil.traceIdsSortedByDescTimestamp().map(input); try { assertThat(sortedTraceIds).containsExactly("c", "b", "a"); } catch (AssertionError e) { assertThat(sortedTraceIds).containsExactly("c", "a", "b"); } }