Code example for PriorityQueue

Methods: offer

0
 
    /** 
     * @tests java.util.PriorityQueue#offer(Object) 
     */ 
    public void test_offerLjava_lang_Object_null() { 
        PriorityQueue<Object> queue = new PriorityQueue<Object>();
        try { 
            queue.offer(null);
            fail("should throw NullPointerException");
        } catch (NullPointerException e) {
            // expected 
        } 
    } 
 
    /** 
     * @tests java.util.PriorityQueue#offer(Object) 
     */ 
    public void test_offer_Ljava_lang_Object_non_Comparable() { 
        PriorityQueue<Object> queue = new PriorityQueue<Object>();
        queue.offer(new Integer(10));
        try {