public void testExceptionElementCollection() {
EntityManager em = emf.createEntityManager();
em.getTransaction().begin();
AnnoExceptionEntity e = new AnnoExceptionEntity();
e.setId(1);
em.persist(e);
e.setElemCollExceptions(new ArrayList<String>());
e.getElemCollExceptions().add(new Exception("Exception 1").toString());
e.getElemCollExceptions().add(new Exception("Exception 2").toString());
em.getTransaction().commit();
em.clear();
e = em.find(AnnoExceptionEntity.class, 1);
assertNotNull(e);
assertNotNull(e.getElemCollExceptions());
assertEquals(2, e.getElemCollExceptions().size());
// we don't really care about ordering for this example.
em.getTransaction().begin();
em.remove(e);
em.getTransaction().commit();