Tip for a forgetful software developer
Lately, when writing JUnit tests I’ve been doing things like:
...
String result = some.method();
assertTrue("Expected " + expected + " but was " + result, result.equals(expected));
...
However, a similar result can be achieved with the semantically more accurate
...
assertEquals(expected, result);
...
This is even easier to type :-)
I did know this, honest!