[java] Change priorityQueue to max priorityqueue