Coding in the small with Google Collections: Objects.equal and hashCode
Part 4 in a Series. Objects.equal(Object,Object) and Objects.hashCode(Object...) provide built-in null-handling, which makes implementing your own equals() and hashCode() methods easy. Before: public boolean equals(Object o) { if (o instanceof Order) { Order that = (Order)o; return (address != null ? address.equals(that.address) : that.address == null)…