@Test public void testEqualsFailsWithOtherObject() { @SuppressWarnings("EqualsBetweenInconvertibleTypes") boolean e = (new ColumnItem(1, null)).equals(0); assertFalse(e); }
@Override public boolean equals(Object obj) { if (!(obj instanceof ColumnItem)) { return false; } if (obj == this) { return true; } ColumnItem rhs = (ColumnItem) obj; return new EqualsBuilder() .append(this.id, rhs.id) .append(this.attributes, rhs.attributes) .isEquals(); }
ColumnItem { @Override public boolean equals(Object obj) { if (!(obj instanceof ColumnItem)) { return false; } if (obj == this) { return true; } ColumnItem rhs = (ColumnItem) obj; return new EqualsBuilder() .append(this.id, rhs.id) .append(this.attributes, rhs.attributes) .isEquals(); } }
ColumnItem { @Override public boolean equals(Object obj) { if (!(obj instanceof ColumnItem)) { return false; } if (obj == this) { return true; } ColumnItem rhs = (ColumnItem) obj; return new EqualsBuilder() .append(this.id, rhs.id) .append(this.attributes, rhs.attributes) .isEquals(); } ColumnItem();   ColumnItem(long id, Map<String, Object> attributes); }
ColumnItem { @Override public boolean equals(Object obj) { if (!(obj instanceof ColumnItem)) { return false; } if (obj == this) { return true; } ColumnItem rhs = (ColumnItem) obj; return new EqualsBuilder() .append(this.id, rhs.id) .append(this.attributes, rhs.attributes) .isEquals(); } ColumnItem();   ColumnItem(long id, Map<String, Object> attributes); long getID(); Map<String, Object> getAttributes(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj); }
ColumnItem { @Override public boolean equals(Object obj) { if (!(obj instanceof ColumnItem)) { return false; } if (obj == this) { return true; } ColumnItem rhs = (ColumnItem) obj; return new EqualsBuilder() .append(this.id, rhs.id) .append(this.attributes, rhs.attributes) .isEquals(); } ColumnItem();   ColumnItem(long id, Map<String, Object> attributes); long getID(); Map<String, Object> getAttributes(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj);  }