switching isEmpty tests to use hamcrest by moaxcp · Pull Request #1634 · exercism/java

To add another dog in this fight, I would also suggest that Guava's Truth package could be a better option. They read like plain English assertions (so it should be pretty obvious what is being asserted), and the assertion errors are much clearer.

An example assertion from that library:

assertThat(someString).contains("testuser@google.com");
assertThat(listOfNumbers).containsExactly(1, 2, 3).inOrder();
assertThat(mapOfFirstNamesToID).containsEntry("John", 123);

Here is an example of what the errors look like:

value of    : projectsByTeam().valuesForKey(corelibs)
missing (1) : truth
───
expected    : [guava, dagger, truth, auto, caliper]
but was     : [guava, auto, dagger, caliper]
multimap was: {corelibs=[guava, auto, dagger, caliper]}

Full disclosure: Guava Truth is what we use at my work so I'm more than a little biased. Just wanted to include it here if additional assertion libraries are up for debate.