Anyone? J unit test cases

compSci
priorityqueue.java

public class PriorityQueue<E> { Heap q; boolean high; /** * The constructor creates a heap. Mode flags if larger values or lower values are of priority. * @param mode of priority value */ public PriorityQueue(PriorityType mode){ q=new Heap(); q.Heap(10); high=true; if(mode.equals(PriorityQueue.PriorityType.LOW_VALUE_PRIORITY)){ high=false; } } /** * getFirst returns the next item in the queue. * If the queue is empty it returns null. * @return E the object in the first position */ public E getFirst(){ if(q.size()==0){ return null; } return (E) q.findMax(); } /** * getPriority returns the priority of the next item in the queue. * It returns Integer.MIN_VALUE if the queue is empty. * @return int of the highest priority */ public int getPriority(){ if(q.size()==0){ return Integer.MIN_VALUE; } obj o = (obj) q.findMax(); int a= o.getPriority(); if(high==false){ a=a*(-1); } return a; } /** * remove removes the first item from the queue. * @return E the object in the first position of the queue */ E remove(){ if(q.size()==0){ return null; } return (E) q.removeMax(); } /** * This adds an item to the queue with the priority priority passed in. * @param item to be added into the queue * @param priority of the item being added */ void add(E item, int priority){ obj o; if(high){ o = new obj(item, priority); }else{ o = new obj(item, (-priority)); } q.insert(o); } /** * isEmpty returns if the queue is empty or not. * @return boolean if it is empty or not */ boolean isEmpty(){ if(q.size()!= 0){ return false; } return true; } /** * size returns the size of the queue * @return the integer size. */ int size(){ return q.size(); } public static enum PriorityType {HIGH_VALUE_PRIORITY, LOW_VALUE_PRIORITY}; }