Code example for PriorityQueue

Methods: addAllcomparatorsize

0
    /** 
     * @tests java.util.PriorityQueue#PriorityQueue(int, Comparator<? super E>) 
     */ 
    public void test_ConstructorILjava_util_Comparator_cast() { 
        MockComparatorCast<Object> objectComparator = new MockComparatorCast<Object>();
        PriorityQueue<Integer> integerQueue = new PriorityQueue<Integer>(100,
                objectComparator);
        assertNotNull(integerQueue);
        assertEquals(0, integerQueue.size());
        assertEquals(objectComparator, integerQueue.comparator());
        Integer[] array = { 2, 45, 7, -12, 9 };
        List<Integer> list = Arrays.asList(array);
        integerQueue.addAll(list);
        assertEquals(list.size(), integerQueue.size());
        // just test here no cast exception raises. 
    } 
 
    /** 
     * @tests java.util.PriorityQueue#PriorityQueue(Collection) 
     */ 
    public void test_ConstructorLjava_util_Colleciton() {