@Override
    public int compare(@NotNull GraphEdge e1, @NotNull GraphEdge e2) {
      Integer d1 = e1.getDownNodeIndex();
      Integer d2 = e2.getDownNodeIndex();

      if (d1 == null) {
        if (d2 == null) return e1.hashCode() - e2.hashCode();
        return 1;
      }
      if (d2 == null) return -1;

      return d1.compareTo(d2);
    }
@Override
    public int compare(@NotNull GraphEdge e1, @NotNull GraphEdge e2)