### Question:
FifoMessageQueue implements MessageQueue { @Override public void clear() { lock.lock(); try { queue.clear(); } finally { lock.unlock(); } } FifoMessageQueue(int prefetchSize); @Override void enqueueFirst(JmsInboundMessageDispatch envelope); @Override void enqueue(JmsInboundMessageDispatch envelope); @Override 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(); @Override String toString();  }### Answer:
@Test public void testClear() { List<JmsInboundMessageDispatch> messages = createFullRangePrioritySet(); for (JmsInboundMessageDispatch envelope: messages) { queue.enqueue(envelope); } assertFalse(queue.isEmpty()); queue.clear(); assertTrue(queue.isEmpty()); }