Code example for PriorityQueue

Methods: remove

0
     *  
     */ 
    public void test_remove_Ljava_lang_Object_null() { 
        Integer[] array = { 2, 45, 7, -12, 9, 23, 17, 1118, 10, 16, 39 };
        List<Integer> list = Arrays.asList(array);
        PriorityQueue<Integer> integerQueue = new PriorityQueue<Integer>(list);
        assertFalse(integerQueue.remove(null));
    } 
 
    /** 
     * @tests java.util.PriorityQueue#remove(Object) 
     *  
     */ 
    public void test_remove_Ljava_lang_Object_not_Compatible() { 
        Integer[] array = { 2, 45, 7, -12, 9, 23, 17, 1118, 10, 16, 39 };
        List<Integer> list = Arrays.asList(array);
        PriorityQueue<Integer> integerQueue = new PriorityQueue<Integer>(list);
        assertFalse(integerQueue.remove(new Float(1.3F)));
  
        // although argument element type is not compatible with those in queue, 
        // but comparator supports it.