[No Audio]
So the test now with Hamcrest, it's getting better.
It's looking good.
However, it's still not perfect and it can be improved.
And the reason is because here
we're actually invoking a production method.
As we know, whenever we invoke methods which
we've created, then there's scope for bugs.
And not only that as well, you're losing that kind
of scientific quality which you have in unit tests.
We just involve one thing, which is the
method you're testing and change different parts around
it and observe what the effect is.
If you have multiple methods from the same thing.
So multiple methods from the production class
which is being tested, then you've got
extra things that can go wrong.
So you don't have this kind of scientific quality.
And you've kind of sacrificed that just for the sake of
convenience, which is not a good road to go down.
So rather than rely on the logic of create
RegularUse, when we're constructing the objects
that it's going to do its expectations against, instead
of doing that, we can do a different thing and we
can compose properties that we're expecting.
And we'll see how to do that in the next video.