That is what the assert classes do.
In the most basic sense, you have things like
assertEquals( 8, x );
Wherein, 8 is the expected value, and x is the real value. If it fails, the user interface will tell you to expected versus actual. More on this here:
In the more complicated approach, you have Hamcrest assertions, which provide even more human readable failures. You can read more about these here:
Europe, Middle East and Africa