### Question:
Device extends AbstractEntity { @Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } Device other = (Device) obj; return this.name.equals(other.name); } protected  Device();  Device(final String name);  Device(final String name, final DeviceInfoReport deviceInfo); static Device getInstance(final String xml); final String getName(); final void setName(final String name); final DeviceInfoReport getDeviceInfo(); final void setDeviceInfo(final DeviceInfoReport deviceInfo); final DeviceGroup getDeviceGroup(); final void setDeviceGroup(final DeviceGroup deviceGroup); final String toXML(); final Timestamp getLastReportTimestamp(); void setLastReportTimestamp(final Timestamp timestamp); final void clearOverride(); final void overrideState(final String newOverrideReason); final String getOverrideReason(); boolean isStateOverridden(); HealthStatus getHealthStatus(); void setHealthStatus(final HealthStatus healthStatus); AppraisalStatus.Status getSupplyChainStatus(); void setSupplyChainStatus(final AppraisalStatus.Status supplyChainValidationStatus); String getSummaryId(); void setSummaryId(final String summaryId); @Override int hashCode(); @Override boolean equals(final Object obj); @Override String toString();  }### Answer:
@Test public void testDeviceEquals() throws Exception { final String name = "my-laptop"; final String otherName = "my-laptop"; final DeviceInfoReport deviceInfo = DeviceInfoReportTest.getTestReport(); final Device device = new Device(name, deviceInfo); final Device other = new Device(otherName, deviceInfo); Assert.assertTrue(device.equals(other)); Assert.assertTrue(other.equals(device)); }
@Test public void testDeviceEqualsNotEqual() throws Exception { final String name = "my-laptop"; final String otherName = "my-other-laptop"; final DeviceInfoReport deviceInfo = DeviceInfoReportTest.getTestReport(); final Device device = new Device(name, deviceInfo); final Device other = new Device(otherName, deviceInfo); Assert.assertFalse(device.equals(other)); Assert.assertFalse(other.equals(device)); }