Question: ION 33252 * Project Explorer Ju JUnit X Finished after 0.111 seconds Runs: 13/13 Failure Trace * Errors: 0 Failures: 0 >deque.Lab08DequeTest [Runner: JUnit

ION 33252 * Project Explorer Ju JUnit X Finished after 0.111 seconds

ION 33252 * Project Explorer Ju JUnit X Finished after 0.111 seconds Runs: 13/13 Failure Trace * Errors: 0 Failures: 0 >deque.Lab08DequeTest [Runner: JUnit 4] (0.040 s) E. 8 QY DequeInterface.ja 94 950 96 97 98 99 100 101 102 103 104 105 106 107 108 1090 110 111 112 1130 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 1290 130 131 1320 133 134 135 136 137 138 139 1400 141 142 1430 144 145 } } DLinkedDeque.jav */ public void testRemoveFrontException() { Exception exception = null; try { } EmptyQueueExcepti } } catch (Exception e) { exception = e; /** * Testing a removeBackException */ public void testremoveBackException() { Exception exception = null; try { deque.removeFront (); fail("removeFront() is not throwing an exceotption when it should"); deque. addToBack ("Hello"); deque. removeFront (); assertTrue ("removeFront () is throwing the wrong type of exceptions", exception instanceof EmptyQueueException); P } catch (Exception e) { exception = e; Lab08DequeTest.ja X /** * Testing a getFornt () */ public void testGetFront () { deque. addToFront ("Kiran"); deque2.removeBack(); fail("removeBack() is not throwing an exception when it should"); BagInterface.jav /** * Testing a getFrontException */ assertTrue ("removeBack() is throwing the wrong type of exceptions", exception instanceof EmptyQueueException); deque. addToFront ("Thapa"); deque. addToFront ("Karan"); assertEquals("Karan", deque.getFront()); public void testGetFrontException() { Exception exception = null; try { ArrayBasedStackT Writable Lab08Deque.java X 61 62 63 64 Smart Insert 65 66 67 68 69 70 71 72 73 74 75 76 770 78 79 80 81 82 83 840 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 1000 101 102 103 104 105 106 107 1080 109 110 111 112 } 1T (1sEmpty()) { } throw new EmptyQueueException(); } T front = getFront (); firstNode = firstNode.getNextNode(); if (firstNode == null) { lastNode = null; else { firstNode.setPreviousNode (null); return front; /** * Remove the item at the rear of the deque. * * @return The item that was removed * @throws EmptyQueueException * */ public T removeBack() { if (isEmpty()) { throw new EmptyQueueException(); } T back = getBack(); lastNode = lastNode.getPreviousNode(); if there is no element at the front if (lastNode == null) { lastNode = null; } else { 121:30: 3220 lastNode.setNextNode (null); } return back; /** * Get the item at the front (the head) of the deque. * deque. * * @return the item at the front of the deque. *@throws EmptyQueueException * */ public T getFront() { if (isEmpty()) { if no element at the front throw new EmptyQueueException(); return firstNode.getData(); o 20 **

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!