### Question:
PriorityMessageQueue implements MessageQueue { @Override public final void close() { if (STATE_FIELD_UPDATER.getAndSet(this, CLOSED) > CLOSED) { synchronized (lock) { lock.notifyAll(); } } } @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();  }### Answer:
@Test public void testClose() { assertFalse(queue.isClosed()); assertTrue(queue.isRunning()); queue.close(); assertTrue(queue.isClosed()); assertFalse(queue.isRunning()); queue.close(); }