ConsumerInstalledProduct extends AbstractHibernateObject { @Override public boolean equals(Object other) { if (!(other instanceof ConsumerInstalledProduct)) { return false; } ConsumerInstalledProduct that = (ConsumerInstalledProduct) other; if (this.getProductId().equals(that.getProductId()) && this.getProductName().equals(that.getProductName()) && ((this.getVersion() == null && that.getVersion() == null) || this.getVersion() != null && this.getVersion().equals(that.getVersion())) && ((this.getArch() == null && that.getArch() == null) || this.getArch() != null && this.getArch().equals(that.getArch()))) { return true; } return false; } ConsumerInstalledProduct();  ConsumerInstalledProduct(String productId, String productName);  ConsumerInstalledProduct(String productId, String productName,
        Consumer consumer);  ConsumerInstalledProduct(String productId, String productName, Consumer consumer,
        String version, String arch, String status, Date startDate, Date endDate);  ConsumerInstalledProduct(Product p);  ConsumerInstalledProduct(Consumer c, Product p); String getProductId(); void setProductId(String productId); String getProductName(); void setProductName(String productName); String getId(); void setId(String id); String getVersion(); void setVersion(String version); String getArch(); void setArch(String arch); String getStatus(); void setStatus(String status); Date getStartDate(); void setStartDate(Date startDate); Date getEndDate(); void setEndDate(Date endDate); @XmlTransient Consumer getConsumer(); void setConsumer(Consumer consumer); @Override boolean equals(Object other); @Override int hashCode(); static final String DB_TABLE; }
@Test public void testEquals() { assertEquals(cip1, cip2); cip1.setVersion(null); cip1.setArch(null); cip2.setVersion(null); cip2.setArch(null); assertEquals(cip1, cip2); }