Java version of Priority Queue homework