new FacesRequest() {
protected void invokeApplication()
{
EntityManager em = (EntityManager) getValue("#{entityManager}");
Product found = em.find(Product.class ,p.getProductId());
assertNotNull("find by id", found);
assertEquals("id", p.getProductId(), found.getProductId());
assertEquals("title", "test", found.getTitle());
em.remove(found);