The NamedMatcher.equals() function currently only checks whether the matcher instance is equal to the other's matcher instance. It should also compare the parentPattern.
It also does not do a basic type comparison or null-check (something that every equals() should do).
Similarly, NamedMatcher.hashCode() currently only returns the hash code of the matcher instance when it should include parentPattern.hashCode() because parentPattern is also used in equals().
This was found by FindBugs.