SettingEntity { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; SettingEntity entity = (SettingEntity) o; return id == entity.id && Objects.equals(name, entity.name) && Objects.equals(settingType, entity.settingType) && Objects.equals(content, entity.content) && Objects.equals(updatedBy, entity.updatedBy) && updateTimestamp == entity.updateTimestamp; } SettingEntity(); long getId(); void setId(long id); String getName(); void setName(String name); String getSettingType(); void setSettingType(String settingType); String getContent(); void setContent(String content); String getUpdatedBy(); void setUpdatedBy(String updatedBy); long getUpdateTimestamp(); void setUpdateTimestamp(long updateTimestamp); SettingEntity clone(); @Override boolean equals(Object o); @Override int hashCode();  }
@Test public void testEquals() { SettingEntity entity = new SettingEntity(); entity.setId(1); entity.setName("motd"); entity.setContent("{tag:random-tag, text:random-text}"); entity.setSettingType("ambari-server"); entity.setUpdatedBy("ambari"); entity.setUpdateTimestamp(1234567890); SettingEntity newEntity = entity.clone(); assertEquals(entity, newEntity); }