Code example for ArrayDeque

Methods: offerLastpollFirstsize

0
 
    /** 
     * @tests {@link java.util.ArrayDeque#pollFirst()} 
     */ 
    public void test_pollFirst() throws Exception { 
        assertTrue(testQue.offerLast(testObjOne));
        assertTrue(testQue.offerLast(testObjTwo));
        assertTrue(testQue.offerLast(testObjThree));
        assertEquals(3, testQue.size());
        assertEquals(testObjOne, testQue.pollFirst());
        assertEquals(2, testQue.size());
        assertEquals(testObjTwo, testQue.pollFirst());
        assertEquals(testObjThree, testQue.pollFirst());
        assertEquals(0, testQue.size());
        assertNull(testQue.pollFirst());
    } 
 
    /** 
     * @tests {@link java.util.ArrayDeque#peekLast()} 
     */ 
    public void test_pollLast() throws Exception {