List<String> list1 = getListOne();
List<String> list2 = getListTwo();
Given the code above, I want to use a JUnit assertThat()
statement to assert that either list1
is empty or that list1
contains all the elements of list2
. The assertTrue
equivalent of this is:
assertTrue(list1.isEmpty() || list1.containsAll(list2))
.
How to formulate this into an assertThat
statement?
Thanks.