Generic list heapsort in Java
for (int i = n;;) {
    if (i == 0) {
        break;
    }


This look very odd instead you can do 

for(int i = n; i &gt; 0;){


Asserts are kinda useless in java, they only work when the jvm is started with the -ea flag (or you do some reflection). instead just test and throw the IllegalArgumentException in the public method and remove the obvious assertions that would throw anyway.