entityManager.getTransaction().begin();
entityManager.persist(person);
entityManager.getTransaction().commit();
JpaLoadableModel<Person> model = new JpaLoadableModel(entityManagerFactory, person);
model.detach();
Assert.assertNotNull(model.getObject());
entityManager.getTransaction().begin();
entityManager.remove(person);
entityManager.getTransaction().commit();
model.detach();
Assert.assertNull(model.getObject());
}