@Test
public void testHasProfile() throws Exception {

    UserGroup ug1 = _repo.save(newUserGroup());
    _repo.save(newUserGroup());
    _repo.save(newUserGroup());
    _repo.save(newUserGroup());
    List<UserGroup> found = _repo.findAll(hasProfile(ug1.getProfile()));
    for (UserGroup userGroup : found) {
        assertEquals(ug1.getProfile(), userGroup.getProfile());
    }
}