question: protected String checkHeap ( ) { if ( comparator == null ) { for ( int i = 1 ; i < size ; i ++ ) { final int parent = ( i - 1 ) > > > 1 ; @ SuppressWarnings ( "unchecked" ) Comparable < Object > po = ( Comparable < Object > ) queue [ parent ] ; if ( po . compareTo ( queue [ i ] ) > 0 ) { return "@" + parent + ": " + queue [ parent ] + " < @" + i + ": " + queue [ i ] ; } } } else { for ( int i = 1 ; i < size ; i ++ ) { final int parent = ( i - 1 ) > > > 1 ; if ( comparator . compare ( queue [ parent ] , queue [ i ] ) > 0 ) { return "@" + parent + ": " + queue [ parent ] + " < @" + i + ": " + queue [ i ] ; } } } return null ; }
target:  Test whether the heap is still valid. Debug method.