### Question:
IdentityMatcher implements Predicate<OpenNode<? extends E, ?>> { @Override public boolean test(OpenNode<? extends E, ?> node) { return node.getElement() == value; } IdentityMatcher(E value); @Override boolean test(OpenNode<? extends E, ?> node); @Override boolean equals(Object o); @Override int hashCode();  }### Answer:
@Test public void matches() { final String element = "a"; final OpenNode<String, Node<String>> node = new ImmutableNode<String, Node<String>>(element, new Object[0]) {}; final Predicate<OpenNode<? extends String, ?>> matcher = new IdentityMatcher<>(element); assertTrue(matcher.test(node)); }
@Test public void notMatches() { final OpenNode<String, Node<String>> node = new ImmutableNode<String, Node<String>>(new String("a"), new Object[0]) {}; final Predicate<OpenNode<? extends String, ?>> matcher = new IdentityMatcher<>(new String("a")); assertFalse(matcher.test(node)); }