### Question:
EqualityMatcher implements Predicate<OpenNode<? extends E, ?>> { @Override public boolean equals(Object o) { if (o == null) { return false; } else if (o == this) { return true; } else if (o.getClass().equals(getClass())) { @SuppressWarnings("unchecked") final EqualityMatcher<E> matcher = (EqualityMatcher<E>)o; return matcher.value.equals(value); } else { return false; } } EqualityMatcher(Object value); @Override boolean test(OpenNode<? extends E, ?> node); @Override boolean equals(Object o); @Override int hashCode();  }### Answer:
@Test public void testEquals() { final Predicate<OpenNode<? extends String, ?>> matcher0 = new EqualityMatcher<>("a"); final Predicate<OpenNode<? extends String, ?>> matcher1 = new EqualityMatcher<>("a"); assertTrue(matcher0.equals(matcher1)); assertTrue(matcher1.equals(matcher0)); assertEquals(matcher0.hashCode(), matcher1.hashCode()); }
@Test public void testEqualsSelf() { final Predicate<OpenNode<? extends String, ?>> matcher0 = new EqualityMatcher<>("a"); assertTrue(matcher0.equals(matcher0)); }
@Test public void testNotEquals0() { final Predicate<OpenNode<? extends String, ?>> matcher0 = new EqualityMatcher<>("a"); final Predicate<OpenNode<? extends String, ?>> matcher1 = new EqualityMatcher<>("b"); assertFalse(matcher0.equals(matcher1)); }
@Test public void testNotEquals1() { final Predicate<OpenNode<? extends String, ?>> matcher0 = new EqualityMatcher<>("a"); assertFalse(matcher0.equals(null)); }
@Test public void testNotEquals2() { final Predicate<OpenNode<? extends String, ?>> matcher0 = new EqualityMatcher<>("a"); assertFalse(matcher0.equals(new Object())); }