}
// TODO Should not be referring to DetachableWithMultiValuePropsJDO since is JDO!!
public void testSerializeWithMultiValueProps() throws Exception {
beginTxn();
DetachableWithMultiValuePropsJDO pojo = new DetachableWithMultiValuePropsJDO();
pojo.setStrList(Utils.newArrayList("c", "d"));
em.persist(pojo);
commitTxn();
assertEquals(ObjectState.HOLLOW_PERSISTENT_NONTRANSACTIONAL, JDOHelper.getObjectState(pojo));
em.close(); // Detaches objects in L1 cache
assertEquals(ObjectState.DETACHED_CLEAN, JDOHelper.getObjectState(pojo));
em = emf.createEntityManager();
assertEquals(ObjectState.DETACHED_CLEAN, JDOHelper.getObjectState(pojo));
pojo = toBytesAndBack(pojo);
assertEquals(Utils.newArrayList("c", "d"), pojo.getStrList());
assertEquals(ObjectState.DETACHED_CLEAN, JDOHelper.getObjectState(pojo));
beginTxn();
assertEquals(ObjectState.DETACHED_CLEAN, JDOHelper.getObjectState(pojo));
// reattach to the pm - this turns our regular list field into a managed
// list field
pojo = em.merge(pojo);
assertEquals(ObjectState.HOLLOW_PERSISTENT_NONTRANSACTIONAL, JDOHelper.getObjectState(pojo));
pojo.getStrList().add("e");
commitTxn();
Entity e = ds.get(KeyFactory.createKey(DetachableWithMultiValuePropsJDO.class.getSimpleName(), pojo.getId()));
assertEquals(3, ((List<String>)e.getProperty("strList")).size());
assertEquals(Utils.newArrayList("c", "d", "e"), e.getProperty("strList"));
}