private List<T> asList(){
  if (asList == null) {
    List<T> smallestFirstList=Lists.newArrayListWithCapacity(asQueue.size());
    while (!asQueue.isEmpty()) {
      smallestFirstList.add(asQueue.poll());
    }
    asList=Lists.reverse(smallestFirstList);
    asQueue=null;
  }
  return asList;
}

private List < T > asList ( ) { if ( asList == null ) { List < T > smallestFirstList = Lists . newArrayListWithCapacity ( asQueue . size ( ) ) ; while ( ! asQueue . isEmpty ( ) ) { smallestFirstList . add ( asQueue . poll ( ) ) ; } asList = Lists . reverse ( smallestFirstList ) ; asQueue = null ; } return asList ; }
returns the contents of this heap as a list sorted largest - to - smallest .
