我刚刚开始使用google的Guava集合(ComparisonChain和Objects)。在我的pojo中,我覆盖了equals方法,所以我首先这样做了:returnComparisonChain.start().compare(this.id,other.id).result()==0;然而,我后来意识到我也可以使用这个:returnObjects.equal(this.id,other.id);而且我看不出什么时候比较链会更好,因为您可以像这样轻松添加更多条件:returnObjects.equal(this.name,other.name)&&Objects.equal(th