### Question:
JmsPoolMessageProducer implements MessageProducer, AutoCloseable { @Override public void close() throws JMSException { doClose(false); } JmsPoolMessageProducer(JmsPoolSession session, MessageProducer messageProducer, Destination destination, AtomicInteger refCount); @Override void close(); @Override void send(Message message); @Override void send(Message message, int deliveryMode, int priority, long timeToLive); @Override void send(Destination destination, Message message); @Override void send(Destination destination, Message message, int deliveryMode, int priority, long timeToLive); @Override void send(Message message, CompletionListener listener); @Override void send(Message message, int deliveryMode, int priority, long timeToLive, CompletionListener listener); @Override void send(Destination destination, Message message, CompletionListener listener); @Override void send(Destination destination, Message message, int deliveryMode, int priority, long timeToLive, CompletionListener listener); @Override Destination getDestination(); @Override int getDeliveryMode(); @Override void setDeliveryMode(int deliveryMode); @Override boolean getDisableMessageID(); @Override void setDisableMessageID(boolean disableMessageID); @Override boolean getDisableMessageTimestamp(); @Override void setDisableMessageTimestamp(boolean disableMessageTimestamp); @Override int getPriority(); @Override void setPriority(int priority); @Override long getTimeToLive(); @Override void setTimeToLive(long timeToLive); @Override long getDeliveryDelay(); @Override void setDeliveryDelay(long deliveryDelay); @Override String toString(); MessageProducer getMessageProducer(); boolean isAnonymousProducer(); AtomicInteger getRefCount(); MessageProducer getDelegate(); Destination getDelegateDestination();  }### Answer:
@Test public void testCloseMoreThanOnce() throws JMSException { JmsPoolConnection connection = (JmsPoolConnection) cf.createQueueConnection(); Session session = connection.createSession(); Queue queue = session.createTemporaryQueue(); MessageProducer producer = session.createProducer(queue); producer.close(); producer.close(); }