@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; OrdersProducts that = (OrdersProducts) o; return !(product != null ? !product.equals(that.product) : that.product != null); }