ConfigurationNode { @Override public int hashCode() { return Objects.hash(id, label, path); } ConfigurationNode(final String id, final String label, final String path); String getId(); String getLabel(); void setLabel(final String label); String getPath(); void setPath(final String path); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }
@Test public void testHashCode() throws Exception { ConfigurationNode node1 = new ConfigurationNode("id", "label", "path"); ConfigurationNode node2 = new ConfigurationNode("id", "label", "path"); ConfigurationNode node3 = new ConfigurationNode("id3", "label", "path"); assertNotNull(node1.hashCode()); assertNotNull(node2.hashCode()); assertNotNull(node3.hashCode()); assertEquals(node1.hashCode(), node2.hashCode()); assertNotEquals(node1.hashCode(), node3.hashCode()); }