Code example for ArrayDeque

Methods: add, clear, isEmpty

0
 
    /** 
     * @tests {@link java.util.ArrayDeque#clear()} 
     */ 
    public void test_clear() throws Exception { 
        assertTrue(testQue.isEmpty());
        testQue.clear();
        assertTrue(testQue.isEmpty());
        assertTrue(testQue.add(testObjOne));
        assertTrue(testQue.add(testObjTwo));
        assertTrue(testQue.add(testObjOne));
        assertTrue(testQue.add(testObjThree));
        testQue.clear();
        assertTrue(testQue.isEmpty());
    } 
 
    /** 
     * @tests {@link java.util.ArrayDeque#toArray()} 
     */ 
    public void test_toArray() throws Exception { 
        assertEquals(0, testQue.toArray().length);