@Test
public void testHasUserId() throws Exception {

    UserGroup ug1 = _repo.save(newUserGroup());
    _repo.save(newUserGroup());
    _repo.save(newUserGroup());
    _repo.save(newUserGroup());
    UserGroup found = _repo.findOne(hasUserId(ug1.getId().getUserId()));
    assertEquals(ug1.getId(), found.getId());
}