code: @Override
      @ConstantTime(amortized = true)
      @SuppressWarnings("unchecked")
      public void meld(MergeableAddressableHeap<K, V> other) {
          FibonacciHeap<K, V> h = (FibonacciHeap<K, V>) other;
  
          // check same comparator
          if (comparator != null) {
              if (h.comparator == null || !h.comparator.equals(comparator)) {
                  throw new IllegalArgumentException("Cannot meld heaps using different comparators!");
              }
          } else if (h.comparator != null) {
              throw new IllegalArgumentException("Cannot meld heaps using different comparators!");
          }
  
          if (h.other != h) {
              throw new IllegalStateException("A heap cannot be used after a meld.");
          }
  
          if (size == 0) {
              // copy the other
              minRoot = h.minRoot;
          } else if (h.size != 0) {
              // concatenate root lists
              Node<K, V> h11 = minRoot;
              Node<K, V> h12 = h11.next;
              Node<K, V> h21 = h.minRoot;
              Node<K, V> h22 = h21.next;
              h11.next = h22;
              h22.prev = h11;
              h21.next = h12;
              h12.prev = h21;
  
              // find new minimum
              if ((comparator == null && ((Comparable<? super K>) h.minRoot.key).compareTo(minRoot.key) < 0)
                      || (comparator != null && comparator.compare(h.minRoot.key, minRoot.key) < 0)) {
                  minRoot = h.minRoot;
              }
          }
          roots += h.roots;
          size += h.size;
  
          // clear other
          h.size = 0;
          h.minRoot = null;
          h.roots = 0;
  
          // take ownership
          h.other = this;
      }
docs: {@inheritDoc}