added test to make sure heap is returned array is unsorted before calling sort.