@Override public boolean equals(Object obj) { if (obj == null || obj.getClass() != this.getClass()) { return false; } if (obj == this) { return true; } EqualsBuilder builder = new EqualsBuilder(); Book other = (Book) obj; builder .append(this.getId(), other.getId()) .append(this.getTitle(), other.getTitle()) .append(this.getIsbn(), other.getIsbn()) .append(this.getPublishedDate(), other.getPublishedDate()); return builder.isEquals(); }