code: @SuppressWarnings("unchecked")
      private void consolidate() {
          int maxDegree = -1;
  
          // for each node in root list
          int numRoots = roots;
          Node<K, V> x = minRoot;
          while (numRoots > 0) {
              Node<K, V> nextX = x.next;
              int d = x.degree;
  
              while (true) {
                  Node<K, V> y = aux[d];
                  if (y == null) {
                      break;
                  }
  
                  // make sure x's key is smaller
                  int c;
                  if (comparator == null) {
                      c = ((Comparable<? super K>) y.key).compareTo(x.key);
                  } else {
                      c = comparator.compare(y.key, x.key);
                  }
                  if (c < 0) {
                      Node<K, V> tmp = x;
                      x = y;
                      y = tmp;
                  }
  
                  // make y a child of x
                  link(y, x);
  
                  aux[d] = null;
                  d++;
              }
  
              // store result
              aux[d] = x;
  
              // keep track of max degree
              if (d > maxDegree) {
                  maxDegree = d;
              }
  
              // advance
              x = nextX;
              numRoots--;
          }
  
          // recreate root list and find minimum root
          minRoot = null;
          roots = 0;
          for (int i = 0; i <= maxDegree; i++) {
              if (aux[i] != null) {
                  addToRootList(aux[i]);
                  aux[i] = null;
              }
          }
      }
docs: /*
  Consolidate: Make sure each root tree has a distinct degree.