I want to use assertEquals() on the two lists list1 and list2.
The problem is, that I don't want to compare the lists like assertEquals(list1, list2). The elements are objects that can return their ids with a function getId(), and I want to check if the lists are equal in terms of the ids (ordered!).
How can I do that? Is functional programming a good idea?