@Override
public void testPostDetach() {
EntityManager em = emf.createEntityManager();
// Create a new department and an employee
IDepartment d = createDepartment();
IEmployee e = createEmployee();
e.setDept(d);
e.setEmpName("John");
Collection<IEmployee> emps = createEmployees();
emps.add(e);
d.setEmployees(emps);
em.getTransaction().begin();
em.persist(d);
em.getTransaction().commit();
resetSQL();
em.clear();
d = findDepartment(em, d.getId());
emps = d.getEmployees();
em.close();
// assert there was no select on the employee table
assertNoneSQLAnyOrder("SELECT .* DC_EMPLOYEE .*");
assertTrue(emps instanceof DelayedPriorityQueueProxy);