code: @Override
      public int compareTo(Edge other) {
          int cmp = super.compareTo(other);
          if (cmp != 0) {
              return cmp;
          }
          return type - other.type;
      }
docs: Compare with other edge.