//q.setOrdering("name ascending");
Collection results = (Collection) q.getResultList();
assertEquals(2, results.size());
Iterator itr = results.iterator();
EagerOuterJoinPC pc = (EagerOuterJoinPC) itr.next();
assertEquals("1", pc.getName());
assertEquals(2, pc.getStringCollection().size());
assertTrue(pc.getStringCollection().contains("1.1"));
assertTrue(pc.getStringCollection().contains("1.2"));
assertEquals(2, pc.getManyManyList().size());
EagerOuterJoinPC2 hpc = (EagerOuterJoinPC2)
pc.getManyManyList().get(0);
assertEquals("1.1", hpc.getName());
hpc = (EagerOuterJoinPC2) pc.getManyManyList().get(1);
assertEquals("1.2", hpc.getName());
pc = (EagerOuterJoinPC) itr.next();
assertEquals("2", pc.getName());
assertEquals(2, pc.getStringCollection().size());
assertTrue(pc.getStringCollection().contains("2.1"));
assertTrue(pc.getStringCollection().contains("2.2"));
assertEquals(2, pc.getManyManyList().size());
hpc = (EagerOuterJoinPC2) pc.getManyManyList().get(0);
assertEquals("2.1", hpc.getName());
hpc = (EagerOuterJoinPC2) pc.getManyManyList().get(1);
assertEquals("2.2", hpc.getName());
assertTrue(!itr.hasNext());
pm.close();
}