A slightly different way to do Boolean assertions in JUnit
In my opinion, the most useful assertion in JUnit is assertEquals()
. Once in a while, though, assertTrue()
comes in handy. Its single parameter form takes a Boolean, its 2-parameter form takes an assertion message and a Boolean (in JUnit 5, the Boolean goes first, before the assertion message).