@Test public void equalsTest() { List<String> vms1 = new ArrayList<String>(); vms1.add("a"); List<String> vms2 = new ArrayList<String>(); vms2.add("a"); EnergyModellerMessage message1 = new EnergyModellerMessage(); message1.setApplicationid("0"); message1.setDeploymentid("1"); message1.setEventid("2"); message1.setGenerattiontimestamp("3"); message1.setReferredtimestamp("4"); message1.setUnit("5"); message1.setValue("6"); message1.setProvider("7"); message1.setVms(vms1); assertFalse(message1.equals(null)); assertFalse(message1.equals(new Object())); EnergyModellerMessage message2 = new EnergyModellerMessage(); message2.setApplicationid("0"); message2.setDeploymentid("1"); message2.setEventid("2"); message2.setGenerattiontimestamp("3"); message2.setReferredtimestamp("4"); message2.setUnit("5"); message2.setValue("6"); message2.setProvider("7"); message2.setVms(vms2); assertTrue(message1.equals(message2)); message2 = new EnergyModellerMessage(); message2.setApplicationid("1"); message2.setDeploymentid("1"); message2.setEventid("2"); message2.setGenerattiontimestamp("3"); message2.setReferredtimestamp("4"); message2.setUnit("5"); message2.setValue("6"); message2.setProvider("7"); message2.setVms(vms2); assertFalse(message1.equals(message2)); message2 = new EnergyModellerMessage(); message2.setApplicationid("0"); message2.setDeploymentid("2"); message2.setEventid("2"); message2.setGenerattiontimestamp("3"); message2.setReferredtimestamp("4"); message2.setUnit("5"); message2.setValue("6"); message2.setProvider("7"); message2.setVms(vms2); assertFalse(message1.equals(message2)); message2 = new EnergyModellerMessage(); message2.setApplicationid("0"); message2.setDeploymentid("1"); message2.setEventid("3"); message2.setGenerattiontimestamp("3"); message2.setReferredtimestamp("4"); message2.setUnit("5"); message2.setValue("6"); message2.setProvider("7"); message2.setVms(vms2); assertFalse(message1.equals(message2)); message2 = new EnergyModellerMessage(); message2.setApplicationid("0"); message2.setDeploymentid("1"); message2.setEventid("2"); message2.setGenerattiontimestamp("4"); message2.setReferredtimestamp("4"); message2.setUnit("5"); message2.setValue("6"); message2.setProvider("7"); message2.setVms(vms2); assertFalse(message1.equals(message2)); message2 = new EnergyModellerMessage(); message2.setApplicationid("0"); message2.setDeploymentid("1"); message2.setEventid("2"); message2.setGenerattiontimestamp("3"); message2.setReferredtimestamp("5"); message2.setUnit("5"); message2.setValue("6"); message2.setProvider("7"); message2.setVms(vms2); assertFalse(message1.equals(message2)); message2 = new EnergyModellerMessage(); message2.setApplicationid("0"); message2.setDeploymentid("1"); message2.setEventid("2"); message2.setGenerattiontimestamp("3"); message2.setReferredtimestamp("4"); message2.setUnit("6"); message2.setValue("6"); message2.setProvider("7"); message2.setVms(vms2); assertFalse(message1.equals(message2)); message2 = new EnergyModellerMessage(); message2.setApplicationid("0"); message2.setDeploymentid("1"); message2.setEventid("2"); message2.setGenerattiontimestamp("3"); message2.setReferredtimestamp("4"); message2.setUnit("5"); message2.setValue("7"); message2.setProvider("7"); message2.setVms(vms2); assertFalse(message1.equals(message2)); message2 = new EnergyModellerMessage(); message2.setApplicationid("0"); message2.setDeploymentid("1"); message2.setEventid("2"); message2.setGenerattiontimestamp("3"); message2.setReferredtimestamp("4"); message2.setUnit("5"); message2.setValue("6"); message2.setProvider("8"); message2.setVms(vms2); assertFalse(message1.equals(message2)); vms2.add("b"); message2 = new EnergyModellerMessage(); message2.setApplicationid("0"); message2.setDeploymentid("1"); message2.setEventid("2"); message2.setGenerattiontimestamp("3"); message2.setReferredtimestamp("4"); message2.setUnit("5"); message2.setValue("6"); message2.setProvider("7"); message2.setVms(vms2); assertFalse(message1.equals(message2)); }
@Override public boolean equals(Object aThat) { if(this == aThat) return true; if(!(aThat instanceof EnergyModellerMessage)) return false; EnergyModellerMessage that = (EnergyModellerMessage) aThat; if(EqualsUtil.areEqual(this.provider, that.getProvider()) && EqualsUtil.areEqual(this.applicationid, that.applicationid) && EqualsUtil.areEqual(this.deploymentid, that.deploymentid) && EqualsUtil.areEqual(this.eventid, that.eventid) && EqualsUtil.areEqual(this.generattiontimestamp, that.generattiontimestamp) && EqualsUtil.areEqual(this.referredtimestamp, that.referredtimestamp) && EqualsUtil.areEqual(this.value, that.value) && EqualsUtil.areEqual(this.unit, that.unit) && EqualsUtil.areEqual(this.vms, that.vms)) { return true; } else { return false; } }
EnergyModellerMessage { @Override public boolean equals(Object aThat) { if(this == aThat) return true; if(!(aThat instanceof EnergyModellerMessage)) return false; EnergyModellerMessage that = (EnergyModellerMessage) aThat; if(EqualsUtil.areEqual(this.provider, that.getProvider()) && EqualsUtil.areEqual(this.applicationid, that.applicationid) && EqualsUtil.areEqual(this.deploymentid, that.deploymentid) && EqualsUtil.areEqual(this.eventid, that.eventid) && EqualsUtil.areEqual(this.generattiontimestamp, that.generattiontimestamp) && EqualsUtil.areEqual(this.referredtimestamp, that.referredtimestamp) && EqualsUtil.areEqual(this.value, that.value) && EqualsUtil.areEqual(this.unit, that.unit) && EqualsUtil.areEqual(this.vms, that.vms)) { return true; } else { return false; } } }
EnergyModellerMessage { @Override public boolean equals(Object aThat) { if(this == aThat) return true; if(!(aThat instanceof EnergyModellerMessage)) return false; EnergyModellerMessage that = (EnergyModellerMessage) aThat; if(EqualsUtil.areEqual(this.provider, that.getProvider()) && EqualsUtil.areEqual(this.applicationid, that.applicationid) && EqualsUtil.areEqual(this.deploymentid, that.deploymentid) && EqualsUtil.areEqual(this.eventid, that.eventid) && EqualsUtil.areEqual(this.generattiontimestamp, that.generattiontimestamp) && EqualsUtil.areEqual(this.referredtimestamp, that.referredtimestamp) && EqualsUtil.areEqual(this.value, that.value) && EqualsUtil.areEqual(this.unit, that.unit) && EqualsUtil.areEqual(this.vms, that.vms)) { return true; } else { return false; } }  }
EnergyModellerMessage { @Override public boolean equals(Object aThat) { if(this == aThat) return true; if(!(aThat instanceof EnergyModellerMessage)) return false; EnergyModellerMessage that = (EnergyModellerMessage) aThat; if(EqualsUtil.areEqual(this.provider, that.getProvider()) && EqualsUtil.areEqual(this.applicationid, that.applicationid) && EqualsUtil.areEqual(this.deploymentid, that.deploymentid) && EqualsUtil.areEqual(this.eventid, that.eventid) && EqualsUtil.areEqual(this.generattiontimestamp, that.generattiontimestamp) && EqualsUtil.areEqual(this.referredtimestamp, that.referredtimestamp) && EqualsUtil.areEqual(this.value, that.value) && EqualsUtil.areEqual(this.unit, that.unit) && EqualsUtil.areEqual(this.vms, that.vms)) { return true; } else { return false; } }  String getProvider(); void setProvider(String provider); String getApplicationid(); void setApplicationid(String applicationid); String getEventid(); void setEventid(String eventid); List<String> getVms(); void setVms(List<String> vms); String getDeploymentid(); void setDeploymentid(String deploymentid); String getUnit(); void setUnit(String unit); String getGenerattiontimestamp(); void setGenerattiontimestamp(String generattiontimestamp); String getReferredtimestamp(); void setReferredtimestamp(String referredtimestamp); String getValue(); void setValue(String value); @Override boolean equals(Object aThat); }
EnergyModellerMessage { @Override public boolean equals(Object aThat) { if(this == aThat) return true; if(!(aThat instanceof EnergyModellerMessage)) return false; EnergyModellerMessage that = (EnergyModellerMessage) aThat; if(EqualsUtil.areEqual(this.provider, that.getProvider()) && EqualsUtil.areEqual(this.applicationid, that.applicationid) && EqualsUtil.areEqual(this.deploymentid, that.deploymentid) && EqualsUtil.areEqual(this.eventid, that.eventid) && EqualsUtil.areEqual(this.generattiontimestamp, that.generattiontimestamp) && EqualsUtil.areEqual(this.referredtimestamp, that.referredtimestamp) && EqualsUtil.areEqual(this.value, that.value) && EqualsUtil.areEqual(this.unit, that.unit) && EqualsUtil.areEqual(this.vms, that.vms)) { return true; } else { return false; } }  String getProvider(); void setProvider(String provider); String getApplicationid(); void setApplicationid(String applicationid); String getEventid(); void setEventid(String eventid); List<String> getVms(); void setVms(List<String> vms); String getDeploymentid(); void setDeploymentid(String deploymentid); String getUnit(); void setUnit(String unit); String getGenerattiontimestamp(); void setGenerattiontimestamp(String generattiontimestamp); String getReferredtimestamp(); void setReferredtimestamp(String referredtimestamp); String getValue(); void setValue(String value); @Override boolean equals(Object aThat);  }