@Test public void equals() throws Exception { Node node1 = new Node(); node1.setKey("a"); node1.setVersion(1); node1.setCreateReversion(1); node1.setModReversion(0); node1.setValue("value"); Node node2 = new Node(); node2.setKey("a"); node2.setVersion(1); node2.setCreateReversion(1); node2.setModReversion(0); node2.setValue("value"); assertEquals(node1.hashCode(), node2.hashCode()); assertTrue(node1.equals(node2)); }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Node nodeInfo = (Node) o; if (createReversion != nodeInfo.createReversion) return false; if (modReversion != nodeInfo.modReversion) return false; if (version != nodeInfo.version) return false; if (!key.equals(nodeInfo.key)) return false; return value.equals(nodeInfo.value); }
Node { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Node nodeInfo = (Node) o; if (createReversion != nodeInfo.createReversion) return false; if (modReversion != nodeInfo.modReversion) return false; if (version != nodeInfo.version) return false; if (!key.equals(nodeInfo.key)) return false; return value.equals(nodeInfo.value); } }
Node { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Node nodeInfo = (Node) o; if (createReversion != nodeInfo.createReversion) return false; if (modReversion != nodeInfo.modReversion) return false; if (version != nodeInfo.version) return false; if (!key.equals(nodeInfo.key)) return false; return value.equals(nodeInfo.value); } Node();  Node(String key, String value, long modVersion);  Node(String key, String value, long createReversion, long modReversion, long version); }
Node { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Node nodeInfo = (Node) o; if (createReversion != nodeInfo.createReversion) return false; if (modReversion != nodeInfo.modReversion) return false; if (version != nodeInfo.version) return false; if (!key.equals(nodeInfo.key)) return false; return value.equals(nodeInfo.value); } Node();  Node(String key, String value, long modVersion);  Node(String key, String value, long createReversion, long modReversion, long version); long getCreateReversion(); void setCreateReversion(long createReversion); String getKey(); void setKey(String key); String getValue(); void setValue(String value); long getModReversion(); void setModReversion(long modReversion); long getVersion(); void setVersion(long version); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); }
Node { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Node nodeInfo = (Node) o; if (createReversion != nodeInfo.createReversion) return false; if (modReversion != nodeInfo.modReversion) return false; if (version != nodeInfo.version) return false; if (!key.equals(nodeInfo.key)) return false; return value.equals(nodeInfo.value); } Node();  Node(String key, String value, long modVersion);  Node(String key, String value, long createReversion, long modReversion, long version); long getCreateReversion(); void setCreateReversion(long createReversion); String getKey(); void setKey(String key); String getValue(); void setValue(String value); long getModReversion(); void setModReversion(long modReversion); long getVersion(); void setVersion(long version); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }