@Test
@Transactional
public void testListProfiles() throws InstanceNotFoundException{
User user = createUser(getUniqueName());
userDAO.save(user);
Profile profile = createProfile(getUniqueName());
profileDAO.save(profile);
int previous = user.getProfiles().size();
user.addProfile(profile);
userDAO.save(user);
assertEquals(previous + 1, userDAO.find(user.getId()).getProfiles().size());
previous = user.getProfiles().size();
user.removeProfile(profile);
userDAO.save(user);
assertEquals(previous - 1, userDAO.find(user.getId()).getProfiles().size());
}