### Question:
JmsPoolMessageConsumer implements MessageConsumer, AutoCloseable { @Override public String getMessageSelector() throws JMSException { checkClosed(); return messageConsumer.getMessageSelector(); } JmsPoolMessageConsumer(JmsPoolSession session, MessageConsumer messageConsumer); @Override void close(); @Override MessageListener getMessageListener(); @Override String getMessageSelector(); @Override Message receive(); @Override Message receive(long timeout); @Override Message receiveNoWait(); @Override void setMessageListener(MessageListener listener); @Override String toString(); MessageConsumer getMessageConsumer();  }### Answer:
@Test public void testGetMessageSelector() throws JMSException { JmsPoolConnection connection = (JmsPoolConnection) cf.createQueueConnection(); Session session = connection.createSession(); Queue queue = session.createTemporaryQueue(); MessageConsumer consumer = session.createConsumer(queue, "Color = Red"); assertNotNull(consumer.getMessageSelector()); assertEquals("Color = Red", consumer.getMessageSelector()); consumer.close(); try { consumer.getMessageSelector(); fail("Should not be able to interact with closed consumer"); } catch (IllegalStateException ise) {} }