EventCodeParam { @Override public boolean equals(Object obj) { if (obj == null) { return false; } if (!this.getClass().equals(obj.getClass())) { return false; } EventCodeParam toCheck = (EventCodeParam) obj; if (getEventCode() == null && toCheck.getEventCode() != null) { return false; } else if (getEventCode() != null && !getEventCode().equals(toCheck.getEventCode())) { return false; } if (getEventCodeScheme() == null && toCheck.getEventCodeScheme() != null) { return false; } else if (getEventCodeScheme() != null && !getEventCodeScheme().equals(toCheck.getEventCodeScheme())) { return false; } return true; }  String getEventCode(); void setEventCode(String eventCode); String getEventCodeScheme(); void setEventCodeScheme(String eventCodeScheme); @Override int hashCode(); @Override boolean equals(Object obj);  }
@Test public void testEquals() { EventCodeParam param1 = getNewEventCodeParam(); EventCodeParam param2 = getNewEventCodeParam(); assertTrue(param1.equals(param2)); }