### Question:
JmsPoolJMSConsumer implements JMSConsumer, AutoCloseable { @Override public void close() { try { consumer.close(); } catch (JMSException e) { throw JMSExceptionSupport.createRuntimeException(e); } } JmsPoolJMSConsumer(JmsPoolMessageConsumer consumer); @Override void close(); @Override MessageListener getMessageListener(); @Override String getMessageSelector(); @Override void setMessageListener(MessageListener listener); @Override Message receive(); @Override Message receive(long timeout); @Override Message receiveNoWait(); @Override T receiveBody(Class<T> desired); @Override T receiveBody(Class<T> desired, long timeout); @Override T receiveBodyNoWait(Class<T> desired); @Override String toString();  }### Answer:
@Test public void testCloseMoreThanOnce() throws JMSException { JMSConsumer consumer = context.createConsumer(context.createTemporaryQueue()); consumer.close(); consumer.close(); }
@Test public void testJMSExOnConsumerCloseConvertedToJMSREx() throws JMSException { JMSConsumer consumer = context.createConsumer(context.createTemporaryQueue()); MockJMSConnection connection = (MockJMSConnection) context.getConnection(); connection.addConnectionListener(new MockJMSDefaultConnectionListener() { @Override public void onCloseMessageConsumer(MockJMSSession session, MockJMSMessageConsumer consumer) throws JMSException { throw new IllegalStateException("Some failure"); } }); try { consumer.close(); fail("Should throw on wrapped consumer throw"); } catch (IllegalStateRuntimeException isre) {} }