One of the things that you will use very frequently in test automation is assertions:

assertTrue

assertEquals

assertFalse

They allow adding verifications to the unit tests. If an assertion passes, the unit test execution continues. If an assertion fails, the unit test execution stops and the remaining code lines are ignored. If we use them so much, how about we try to understand how they work?

One of the best sources of learning how something works is the source code.

If we want to learn how to code better, the source code of popular frameworks provides many good lessons.
In this case, the code uses many small methods which are very simple and clear instead of bigger methods.