static Comparator<String> compareBySnapshot(Map<String, SnapshotDto> snapshotByProjectUuid) {
    return (uuid1, uuid2) -> {
      SnapshotDto snapshot1 = snapshotByProjectUuid.get(uuid1);
      SnapshotDto snapshot2 = snapshotByProjectUuid.get(uuid2);
      if (snapshot1 == null && snapshot2 == null) {
        return 0;
      }
      if (snapshot1 == null) {
        return 1;
      }
      if (snapshot2 == null) {
        return -1;
      }
      return snapshot2.getCreatedAt().compareTo(snapshot1.getCreatedAt());
    };
  }
@Test
  public void verify_comparator_transitivity() {
    Map<String, SnapshotDto> map = new HashMap<>();
    map.put("A", new SnapshotDto().setCreatedAt(1L));
    map.put("B", new SnapshotDto().setCreatedAt(2L));
    map.put("C", new SnapshotDto().setCreatedAt(-1L));
    List<String> uuids = new ArrayList<>(map.keySet());
    uuids.add("D");
    Comparators.verifyTransitivity(AsyncIssueIndexingImpl.compareBySnapshot(map), uuids);
  }