em.getTransaction().commit();
em.clear();
// Verify order is correct.
for (int i = 0; i < trainers.length; i++) {
Trainer trainer = em.find(Trainer.class, trainers[i].getId());
assertNotNull(trainer);
List<Player> trainedPlayers = trainer.getPlayersTrained();
assertNotNull(trainedPlayers);
assertEquals(trainedPlayers.size(), 5);
for (int j = trainedPlayers.size() - 1; j >=0 ; j--) {