@Test public void testEquals() { BigInteger one = new BigInteger("1"); BigInteger three = new BigInteger("3"); String cReg1 = "contextRegister1"; String cReg2 = "contextRegister2"; ContextRegisterInfo info1 = new ContextRegisterInfo(cReg1); ContextRegisterInfo info2 = new ContextRegisterInfo(cReg1); ContextRegisterInfo info3 = new ContextRegisterInfo(cReg2); Assert.assertNotEquals(null, info1); Assert.assertNotEquals(this, info1); assertEquals(info1, info1); assertEquals(info1, info2); assertEquals(info2, info1); Assert.assertNotEquals(info1, info3); Assert.assertNotEquals(info3, info1); info1.setValue(one); info2.setValue(one); info3.setValue(three); assertEquals(info1, info1); assertEquals(info1, info2); assertEquals(info2, info1); Assert.assertNotEquals(info1, info3); Assert.assertNotEquals(info3, info1); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } ContextRegisterInfo other = (ContextRegisterInfo) obj; if (!contextRegister.equals(other.getContextRegister())) { return false; } if (value == null) { return (other.getValue() == null); } if (other.getValue() == null) { return false; } return value.equals(other.getValue()); }
ContextRegisterInfo { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } ContextRegisterInfo other = (ContextRegisterInfo) obj; if (!contextRegister.equals(other.getContextRegister())) { return false; } if (value == null) { return (other.getValue() == null); } if (other.getValue() == null) { return false; } return value.equals(other.getValue()); } }
ContextRegisterInfo { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } ContextRegisterInfo other = (ContextRegisterInfo) obj; if (!contextRegister.equals(other.getContextRegister())) { return false; } if (value == null) { return (other.getValue() == null); } if (other.getValue() == null) { return false; } return value.equals(other.getValue()); } ContextRegisterInfo();  ContextRegisterInfo(String contextRegister); }
ContextRegisterInfo { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } ContextRegisterInfo other = (ContextRegisterInfo) obj; if (!contextRegister.equals(other.getContextRegister())) { return false; } if (value == null) { return (other.getValue() == null); } if (other.getValue() == null) { return false; } return value.equals(other.getValue()); } ContextRegisterInfo();  ContextRegisterInfo(String contextRegister); String getContextRegister(); void setContextRegister(String contextRegister); BigInteger getValueAsBigInteger(); void setValue(BigInteger valueAsBigInteger); String getValue(); void setValue(String value); @Override String toString(); @Override boolean equals(Object obj); @Override int hashCode(); }
ContextRegisterInfo { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } ContextRegisterInfo other = (ContextRegisterInfo) obj; if (!contextRegister.equals(other.getContextRegister())) { return false; } if (value == null) { return (other.getValue() == null); } if (other.getValue() == null) { return false; } return value.equals(other.getValue()); } ContextRegisterInfo();  ContextRegisterInfo(String contextRegister); String getContextRegister(); void setContextRegister(String contextRegister); BigInteger getValueAsBigInteger(); void setValue(BigInteger valueAsBigInteger); String getValue(); void setValue(String value); @Override String toString(); @Override boolean equals(Object obj); @Override int hashCode();  }