[No Audio]
So I can actually replace
these two matcher expressions. So just
to take a review in the assert that method here,
we can see that it takes the actual collection
we're going to inspect and then we're passing in
a matcher and this matches contained in any order,
which in turn also takes a series of matches and
evaluates each matcher and ensures that they both
evaluate to true, but they can evaluate to true in any
order. So what I've used here in this expression is
I've used the equal to matcher and what equal to does
if we click into this, you can see it delegates
is equal equal to method and when it evaluates the
matcher which is basically this matches method here,
if we drill into this our equal method, this is the
actual logic of that matcher there, which pretty much
is either, comparing the actual and the expected
objects by an array comparison if there happens to be
arrays. But the more likely cases are actually objects.
And you can see here it's
physically just invoking this .equals method.
So the standard equals method from java.lang.object.
So to go back out to where before, we now
know that the equalTo matcher is basically going to
use a Java equals comparison with this object here and
evaluate it against objects in this set of
objects here and the same thing for this one too.