assertSame(copy.getUsers().get(0), user);
}
@Test
public void copyUserGroupShouldCopyCorrectlyIfAllFieldsFilled() {
Group group = new Group("name", "description");
group.setId(1);
group.setUuid("uuid");
List<User> users = Arrays.asList(new User("username", "email@mail.com", "pass"),
new User("username1", "email1@mail.com", "pass1"));
group.setUsers(users);
JCUser newUser = new JCUser("username", "email@mail.com", "pass");
Group copy = JCUser.copyUserGroup(group, newUser);
assertNotSame(copy, group);
assertUserGroupEqualsIgnoreUsers(copy, group);
assertEquals(copy.getUsers().size(), 1);
assertSame(copy.getUsers().get(0), newUser);
}