public override bool Equals(System.Object otherBook) { if (!(otherBook is Book)) { return(false); } else { Book newBook = (Book)otherBook; bool idEquality = this.GetId() == newBook.GetId(); bool titleEquality = this.GetTitle() == newBook.GetTitle(); bool copiesEquality = this.GetCopies() == newBook.GetCopies(); return(idEquality && titleEquality && copiesEquality); } }