code: public final T pop()
      {
          if (size > 0)
          {
              T result = heap[1]; // save first value
              heap[1] = heap[size]; // move last to first
              heap[size] = null; // permit GC of objects
              size--;
              downHeap(); // adjust heap
              return result;
          }
          else
          {
              return null;
          }
      }
docs: Removes and returns the least element of the PriorityQueue in log(size)
  time.