### Question:
JmsPoolJMSConsumer implements JMSConsumer, AutoCloseable { @Override public Message receive() { try { return consumer.receive(); } 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 testReceive() throws JMSException { JMSConsumer consumer = context.createConsumer(context.createTemporaryQueue()); assertNull(consumer.receive()); consumer.close(); try { consumer.receive(); fail("Should not be able to interact with closed consumer"); } catch (IllegalStateRuntimeException ise) {} }