@Test public void testClear() { List<JmsInboundMessageDispatch> messages = createFullRangePrioritySet(); for (JmsInboundMessageDispatch envelope: messages) { queue.enqueue(envelope); } assertFalse(queue.isEmpty()); queue.clear(); assertTrue(queue.isEmpty()); }
@Override public void clear() { synchronized (lock) { for (int i = 0; i <= MAX_PRIORITY; i++) { lists[i].clear(); } this.size = 0; } }
PriorityMessageQueue implements MessageQueue { @Override public void clear() { synchronized (lock) { for (int i = 0; i <= MAX_PRIORITY; i++) { lists[i].clear(); } this.size = 0; } } }
PriorityMessageQueue implements MessageQueue { @Override public void clear() { synchronized (lock) { for (int i = 0; i <= MAX_PRIORITY; i++) { lists[i].clear(); } this.size = 0; } } @SuppressWarnings("unchecked")  PriorityMessageQueue(); }
PriorityMessageQueue implements MessageQueue { @Override public void clear() { synchronized (lock) { for (int i = 0; i <= MAX_PRIORITY; i++) { lists[i].clear(); } this.size = 0; } } @SuppressWarnings("unchecked")  PriorityMessageQueue(); @Override void enqueue(JmsInboundMessageDispatch envelope); @Override void enqueueFirst(JmsInboundMessageDispatch envelope); @Override final JmsInboundMessageDispatch dequeue(long timeout); @Override final JmsInboundMessageDispatch dequeueNoWait(); @Override final void start(); @Override final void stop(); @Override final void close(); @Override final boolean isRunning(); @Override final boolean isClosed(); @Override boolean isEmpty(); @Override int size(); @Override void clear(); }
PriorityMessageQueue implements MessageQueue { @Override public void clear() { synchronized (lock) { for (int i = 0; i <= MAX_PRIORITY; i++) { lists[i].clear(); } this.size = 0; } } @SuppressWarnings("unchecked")  PriorityMessageQueue(); @Override void enqueue(JmsInboundMessageDispatch envelope); @Override void enqueueFirst(JmsInboundMessageDispatch envelope); @Override final JmsInboundMessageDispatch dequeue(long timeout); @Override final JmsInboundMessageDispatch dequeueNoWait(); @Override final void start(); @Override final void stop(); @Override final void close(); @Override final boolean isRunning(); @Override final boolean isClosed(); @Override boolean isEmpty(); @Override int size(); @Override void clear();  }