The documentation for CompareMatcher.withNodeFilter(...) says Registers a filter for nodes so I created two nodefilters and used them like this:
assertThat(actualMessage, isSimilarTo(expectedMessage)
.withNodeFilter(new NodeFilterA())
.withNodeFilter(new NodeFilterB())
);
When this did not work as expected I thought my implementation of the Predicate was incorrect. Only after randomly trying to change things I figured out that only 1 Predicate could be registered as NodeFilter and the documentation was incorrect, or at least incomplete. It should read Registers the filter for nodes or Registers and overwrites the filter for nodes.
Also, when called multiple times it should throw an exception explaining that a second call would overwrite the previously set filter.