### Question:
PoulpeUser extends org.jtalks.common.model.entity.User { public boolean isInGroupWithId(long groupId) { for (Group userGroup : getGroups()) { if (userGroup.getId() == groupId) { return true; } } return false; } PoulpeUser();  PoulpeUser(String username, String email, String password, String salt); boolean isInGroupWithId(long groupId); static PoulpeUser withId(long id); @Override @Length(max = EMAIL_MAX_LENGTH, message = "{user.email.length_constraint_violation}") String getEmail(); @Override String toString();  }### Answer:
@Test public void userShouldBeInGroup() { PoulpeUser user = new PoulpeUser(); user.setGroups(Lists.newArrayList(groupWithId(1), groupWithId(100), groupWithId(200))); assertTrue(user.isInGroupWithId(100)); }
@Test public void userShouldNotBeInGroup() { PoulpeUser user = new PoulpeUser(); user.setGroups(Lists.newArrayList(groupWithId(1), groupWithId(100), groupWithId(200))); assertFalse(user.isInGroupWithId(99)); }