public E top() {
    if ( this.isEmpty() ) {
      throw new EmptyHeapException();
    }

    E oldTop = heap[TOP];
    heap[TOP] = heap[size - 1];
    heap[size - 1] = null;
    size--;
    fixHeap( TOP );
    return oldTop;
  }