### Question:
PerRequestResourceProvider implements ResourceProvider { public Object getInstance(Message m) { return createInstance(m); } PerRequestResourceProvider(Class<?> clazz); boolean isSingleton(); Object getInstance(Message m); void releaseInstance(Message m, Object o); Class<?> getResourceClass();  }### Answer:
@Test public void testGetInstance() { PerRequestResourceProvider rp = new PerRequestResourceProvider(Customer.class); Message message = createMessage(); message.put(Message.QUERY_STRING, "a=aValue"); Customer c = (Customer)rp.getInstance(message); assertNotNull(c.getUriInfo()); assertEquals("aValue", c.getQueryParam()); assertTrue(c.isPostConstuctCalled()); rp.releaseInstance(message, c); assertTrue(c.isPreDestroyCalled()); }
@Test public void testGetInstance() { PerRequestResourceProvider rp = new PerRequestResourceProvider(Customer.class); Message message = new MessageImpl(); message.put(Message.QUERY_STRING, "a=aValue"); Customer c = (Customer)rp.getInstance(message); assertNotNull(c.getUriInfo()); assertEquals("aValue", c.getQueryParam()); assertTrue(c.isPostConstuctCalled()); rp.releaseInstance(message, c); assertTrue(c.isPreDestroyCalled()); }