127128129130131132133134135136137
@Test public void testFIFO() { Queue q = new LinkedBlockingDeque(); q.add("test"); q.add("pest"); assertEquals("test", q.poll()); q = new LinkedBlockingQueue(); q.add("test"); q.add("pest"); assertEquals("test", q.poll());
132133134135136137138139140141142
assertEquals("test", q.poll()); q = new LinkedBlockingQueue(); q.add("test"); q.add("pest"); assertEquals("test", q.poll()); Stack v = new Stack(); v.add("test"); v.add("pest"); assertEquals("pest", v.pop());