1 00:00:00,000 --> 00:00:02,470 [No Audio] 2 00:00:02,470 --> 00:00:03,502 So I can actually replace 3 00:00:03,502 --> 00:00:06,475 these two matcher expressions. So just 4 00:00:06,475 --> 00:00:08,984 to take a review in the assert that method here, 5 00:00:08,984 --> 00:00:12,124 we can see that it takes the actual collection 6 00:00:12,124 --> 00:00:14,322 we're going to inspect and then we're passing in 7 00:00:14,336 --> 00:00:16,966 a matcher and this matches contained in any order, 8 00:00:16,966 --> 00:00:19,924 which in turn also takes a series of matches and 9 00:00:19,924 --> 00:00:22,207 evaluates each matcher and ensures that they both 10 00:00:22,207 --> 00:00:25,232 evaluate to true, but they can evaluate to true in any 11 00:00:25,232 --> 00:00:28,197 order. So what I've used here in this expression is 12 00:00:28,197 --> 00:00:31,184 I've used the equal to matcher and what equal to does 13 00:00:31,184 --> 00:00:34,630 if we click into this, you can see it delegates 14 00:00:34,630 --> 00:00:37,422 is equal equal to method and when it evaluates the 15 00:00:37,436 --> 00:00:39,952 matcher which is basically this matches method here, 16 00:00:39,952 --> 00:00:43,635 if we drill into this our equal method, this is the 17 00:00:43,635 --> 00:00:46,519 actual logic of that matcher there, which pretty much 18 00:00:46,519 --> 00:00:48,852 is either, comparing the actual and the expected 19 00:00:48,852 --> 00:00:51,194 objects by an array comparison if there happens to be 20 00:00:51,194 --> 00:00:53,986 arrays. But the more likely cases are actually objects. 21 00:00:53,986 --> 00:00:55,102 And you can see here it's 22 00:00:55,102 --> 00:00:57,802 physically just invoking this .equals method. 23 00:00:57,802 --> 00:01:01,610 So the standard equals method from java.lang.object. 24 00:01:01,610 --> 00:01:05,804 So to go back out to where before, we now 25 00:01:05,804 --> 00:01:08,444 know that the equalTo matcher is basically going to 26 00:01:08,444 --> 00:01:12,764 use a Java equals comparison with this object here and 27 00:01:12,764 --> 00:01:15,274 evaluate it against objects in this set of 28 00:01:15,274 --> 00:01:17,605 objects here and the same thing for this one too.