### Question:
RegexMatcher implements Predicate<OpenNode<? extends String, ?>> { @Override public boolean test(OpenNode<? extends String, ?> node) { final Matcher matcher = pattern.matcher(node.getElement()); return matcher.matches(); } RegexMatcher(final String pattern); @Override boolean test(OpenNode<? extends String, ?> node); @Override boolean equals(Object o); @Override int hashCode();  }### Answer:
@Test public void nodeMatches0() { final Tree<String, Node<String>> tree = builder.create("A").build(TreeNodeImpl.<String>typeKey()); final Node<String> node = tree.getRoot(); assertTrue(aMatcher.test(node)); }
@Test public void nodeMatches1() { final Node<String> node = builder.create("A").build(TreeNodeImpl.<String>typeKey()).getRoot(); assertTrue(aMatcherAlt.test(node)); }
@Test public void nodeNoMatch0() { final Node<String> node = builder.create("B").build(TreeNodeImpl.<String>typeKey()).getRoot(); assertFalse(aMatcher.test(node)); }
@Test public void nodeNoMatch1() { final Node<String> node = builder.create("B").build(TreeNodeImpl.<String>typeKey()).getRoot(); assertFalse(aMatcherAlt.test(node)); }