code: public Iterator<AddressableHeap.Handle<K, V>> handlesIterator() {
          return new Iterator<AddressableHeap.Handle<K, V>>() {
              private int pos = 1;
  
              public boolean hasNext() {
                  return pos <= size;
              }
  
              public AddressableHeap.Handle<K, V> next() {
                  return array[pos++];
              }
  
              public void remove() {
                  throw new UnsupportedOperationException();
              }
          };
      }
docs: Get an iterator for all handles currently in the heap.
  
  This method is especially useful when building a heap using the heapify
  method. Unspecified behavior will occur if the heap is modified while
  using this iterator.
  
  @return an iterator which will return all handles of the heap