### Question:
RegexMatcher implements Predicate<OpenNode<? extends String, ?>> { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } RegexMatcher that = (RegexMatcher) o; return regex.equals(that.regex); } RegexMatcher(final String pattern); @Override boolean test(OpenNode<? extends String, ?> node); @Override boolean equals(Object o); @Override int hashCode();  }### Answer:
@Test public void testEquals() { final Predicate<OpenNode<? extends String, ?>> matcher0 = new RegexMatcher("A"); final Predicate<OpenNode<? extends String, ?>> matcher1 = new RegexMatcher("A"); assertTrue(matcher0.equals(matcher1)); assertTrue(matcher1.equals(matcher0)); assertEquals(matcher0.hashCode(), matcher1.hashCode()); }
@Test public void testNotEquals0() { final Predicate<OpenNode<? extends String, ?>> matcher0 = new RegexMatcher("A"); final Predicate<OpenNode<? extends String, ?>> matcher1 = new RegexMatcher("B"); assertFalse(matcher0.equals(matcher1)); }
@Test public void testNotEquals1() { final Predicate<OpenNode<? extends String, ?>> matcher0 = new RegexMatcher("A"); assertFalse(matcher0.equals(null)); }
@Test public void testNotEquals2() { final Predicate<OpenNode<? extends String, ?>> matcher0 = new RegexMatcher("A"); assertFalse(matcher0.equals(new Object())); }