Suppose I have a list of User
userList.
class User {
String firstName;
String lastName;
}
Is there a way I can compare using AssertJ
like
assertThat(userList).lastName.equalsTo(List.of("A","B","C"));
?
List<User> users = Arrays.asList(
new User("a", "A"),
new User("b", "B"),
new User("c", "C"));
assertThat(users)
.extracting(User::getLastName)
.containsExactly("A", "B", "C");