ConsumerType extends AbstractHibernateObject<ConsumerType> { @Override public boolean equals(Object anObject) { if (this == anObject) { return true; } if (!(anObject instanceof ConsumerType)) { return false; } ConsumerType another = (ConsumerType) anObject; return label.equals(another.getLabel()); } ConsumerType();  ConsumerType(ConsumerTypeEnum type);  ConsumerType(String labelIn); String getId(); void setId(String id); String getLabel(); void setLabel(String labelIn); boolean isType(ConsumerTypeEnum type); @Override String toString(); @Override boolean equals(Object anObject); @Override int hashCode(); boolean isManifest(); void setManifest(boolean manifest); static final String DB_TABLE; }
@Test public void testEquals() { ConsumerType ct = new ConsumerType("system"); ConsumerType ct1 = new ConsumerType("system"); ConsumerType ct2 = new ConsumerType("fake"); assertTrue(ct.equals(ct1)); assertFalse(ct.equals(ct2)); assertFalse(ct.equals(1)); ct.setId("10"); ct1.setId("11"); assertTrue(ct.equals(ct1)); }