@Test public void testEquals() { ComparableObjectItem item1 = new ComparableObjectItem(1, "XYZ"); ComparableObjectItem item2 = new ComparableObjectItem(1, "XYZ"); assertEquals(item1, item2); assertEquals(item2, item1); item1 = new ComparableObjectItem(2, "XYZ"); assertFalse(item1.equals(item2)); item2 = new ComparableObjectItem(2, "XYZ"); assertEquals(item1, item2); item1 = new ComparableObjectItem(2, null); assertFalse(item1.equals(item2)); item2 = new ComparableObjectItem(2, null); assertEquals(item1, item2); }
@Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof ComparableObjectItem)) { return false; } ComparableObjectItem that = (ComparableObjectItem) obj; if (!this.x.equals(that.x)) { return false; } if (!ObjectUtilities.equal(this.obj, that.obj)) { return false; } return true; }
ComparableObjectItem implements Cloneable, Comparable<ComparableObjectItem>,
        Serializable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof ComparableObjectItem)) { return false; } ComparableObjectItem that = (ComparableObjectItem) obj; if (!this.x.equals(that.x)) { return false; } if (!ObjectUtilities.equal(this.obj, that.obj)) { return false; } return true; } }
ComparableObjectItem implements Cloneable, Comparable<ComparableObjectItem>,
        Serializable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof ComparableObjectItem)) { return false; } ComparableObjectItem that = (ComparableObjectItem) obj; if (!this.x.equals(that.x)) { return false; } if (!ObjectUtilities.equal(this.obj, that.obj)) { return false; } return true; } ComparableObjectItem(Comparable x, Object y); }
ComparableObjectItem implements Cloneable, Comparable<ComparableObjectItem>,
        Serializable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof ComparableObjectItem)) { return false; } ComparableObjectItem that = (ComparableObjectItem) obj; if (!this.x.equals(that.x)) { return false; } if (!ObjectUtilities.equal(this.obj, that.obj)) { return false; } return true; } ComparableObjectItem(Comparable x, Object y); @Override int compareTo(ComparableObjectItem that); @Override Object clone(); @Override boolean equals(Object obj); @Override int hashCode(); }
ComparableObjectItem implements Cloneable, Comparable<ComparableObjectItem>,
        Serializable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof ComparableObjectItem)) { return false; } ComparableObjectItem that = (ComparableObjectItem) obj; if (!this.x.equals(that.x)) { return false; } if (!ObjectUtilities.equal(this.obj, that.obj)) { return false; } return true; } ComparableObjectItem(Comparable x, Object y); @Override int compareTo(ComparableObjectItem that); @Override Object clone(); @Override boolean equals(Object obj); @Override int hashCode();  }