You need to do nothing special for list equality, just use assertEquals.
ArrayList and other lists implement equals() by checking that all objects in the corresponding positions of the lists are equal, using the equals() method of the objects. So you might want to check that the objects in the list implement equals correctly.
Read full article from java - Easy way to compare ArrayLists for equality using JUnit? - Stack Overflow
No comments:
Post a Comment