Fest assertThat List<String> partially matches another List<String>

677 Views Asked by At

Is there a simple way of using fest assertions to check that a list of string partially contains it's value in another list of strings.

For example, I'm able to use the following code to check that the values in one list match exactly to the values in another list:

import static org.fest.assertions.api.Assertions.asserThat;

...

List<String> actual = Arrays.asList("Hello John", "Hi Sarah", "Yo Mac");
List<String> expected = Arrays.asList("Hi Sarah", "Hello John", "Yo Mac");

assertThat(actual).containsAll(expected);

However, is there an easy way to compare the following:

List<String> actual = Arrays.asList("Hello John", "Hi Sarah", "Yo Mac");
List<String> expected = Arrays.asList("Sarah", "John", "Mac");
0

There are 0 best solutions below