code: @Override
      @LogarithmicTime
      @SuppressWarnings("unchecked")
      public AddressableHeap.Handle<K, V> insert(K key, V value) {
          if (key == null) {
              throw new NullPointerException("Null keys not permitted");
          }
          Node n = new Node(key, value);
  
          // easy special cases
          if (size == 0) {
              root = n;
              size = 1;
              return n;
          } else if (size == 1) {
              int c;
              if (comparator == null) {
                  c = ((Comparable<? super K>) key).compareTo(root.key);
              } else {
                  c = comparator.compare(key, root.key);
              }
              if (c < 0) {
                  n.o_c = root;
                  root.y_s = n;
                  root = n;
              } else {
                  root.o_c = n;
                  n.y_s = root;
              }
              size = 2;
              return n;
          }
  
          // find parent of last node and hang
          Node p = findParentNode(size + 1);
          if (p.o_c == null) {
              p.o_c = n;
          } else {
              p.o_c.y_s = n;
          }
          n.y_s = p;
  
          // increase size
          size++;
  
          // fix priorities
          fixup(n);
  
          return n;
      }
docs: {@inheritDoc}