public List<Long> extractOrderedList(){
  Long[] array=new Long[heap.size()];
  for (int i=heap.size() - 1; i >= 0; i--) {
    array[i]=heap.remove();
  }
  return Arrays.asList(array);
}

public List < Long > extractOrderedList ( ) { Long [ ] array = new Long [ heap . size ( ) ] ; for ( int i = heap . size ( ) - 1 ; i >= 0 ; i -- ) { array [ i ] = heap . remove ( ) ; } return Arrays . asList ( array ) ; }
returns the values in the heap , ordered largest to smallest .
