// Persist the related entities
BattingOrder order = new BattingOrder();
order.setBatters(playersArr);
em.persist(order);
em.getTransaction().commit();
em.refresh(order);
em.clear();
// Verify order is correct.
BattingOrder newOrder = em.find(BattingOrder.class, order.id);
assertNotNull(newOrder);