}
@Test
@Transactional
public void testGetByMaterial() {
MaterialAssignment assignment1 = createValidMaterialAssignment();
MaterialAssignment assignment2 = createValidMaterialAssignment();
materialAssignmentDAO.save(assignment1);
materialAssignmentDAO.save(assignment2);
assertTrue(materialAssignmentDAO.getByMaterial(assignment1.getMaterial()).contains(assignment1));
assertFalse(materialAssignmentDAO.getByMaterial(assignment1.getMaterial()).contains(assignment2));
assignment2.setMaterial(assignment1.getMaterial());
assertTrue(materialAssignmentDAO.getByMaterial(assignment1.getMaterial()).contains(assignment2));
}