public static void assertEqualUser(User user1, User user2) {
assertEquals(user1.getUsername(), user2.getUsername());
assertEquals(user1.getAttributes().size(), user2.getAttributes().size());
for (int i = 0; i < user1.getAttributes().size(); i++) {
Attribute attr1 = user1.getAttributes().get(i);
Attribute attr2 = user2.getAttributes().get(i);
assertEquals(attr1.getAttributeName(), attr2.getAttributeName());
assertEquals(attr1.getUuid(), attr2.getUuid());
assertEquals(attr1.getValues().size(), attr2.getValues().size());
for (int n = 0; n < attr1.getValues().size(); n++) {
assertEquals(attr1.getValues().get(n), attr2.getValues().get(n));
}
}
}