NodeTypePattern implements RestrictionPattern { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (obj instanceof NodeTypePattern) { NodeTypePattern other = (NodeTypePattern) obj; return nodeTypeNames.equals(other.nodeTypeNames); } return false; } NodeTypePattern(@NotNull Iterable<String> nodeTypeNames); @Override boolean matches(@NotNull Tree tree, @Nullable PropertyState property); @Override boolean matches(@NotNull String path); @Override boolean matches(); @Override int hashCode(); @Override String toString(); @Override boolean equals(Object obj);  }
@Test public void testEquals() { assertEquals(pattern, pattern); assertEquals(pattern, new NodeTypePattern(ntNames)); }