### Question:
GatekeeperAWSInstance { @Override public boolean equals(Object o){ if(this == o){ return true; } if (o == null || !getClass().equals(o.getClass())) { return false; } GatekeeperAWSInstance that = (GatekeeperAWSInstance)o; return Objects.equals(this.instanceId, that.getInstanceId()) && Objects.equals(this.application, that.getApplication()) && Objects.equals(this.name, that.getName()) && Objects.equals(this.ip, that.getIp()) && Objects.equals(this.ssmStatus, that.getSsmStatus()) && Objects.equals(this.platform, that.getPlatform()); } GatekeeperAWSInstance(String instanceId, String application, String name, String ip, String platform); String getInstanceId(); String getApplication(); String getName(); String getIp(); String getSsmStatus(); String getPlatform(); GatekeeperAWSInstance setSsmStatus(String ssmStatus); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void testEquals(){ String instanceId = "i-h3110"; String application = "TST"; String name = "TSTBOX"; String ip = "123.4.5.6"; String platform="Linux"; GatekeeperAWSInstance awsInstance1 = new GatekeeperAWSInstance(instanceId, application, name, ip,platform); GatekeeperAWSInstance awsInstance2 = new GatekeeperAWSInstance(instanceId, application, name, ip,platform); String instanceId2 = "i-h310"; String application2 = "TST2"; String name2 = "TST2BOX"; String ip2 = "1232.4.5.6"; String platform2 = "Windows"; GatekeeperAWSInstance awsInstance3 = new GatekeeperAWSInstance(instanceId2, application2, name2, ip2,platform2); GatekeeperAWSInstance awsInstance4 = new GatekeeperAWSInstance(instanceId, application2, name, ip,platform); GatekeeperAWSInstance awsInstance5 = new GatekeeperAWSInstance(instanceId, application, name2, ip,platform); GatekeeperAWSInstance awsInstance6 = new GatekeeperAWSInstance(instanceId, application, name, ip2,platform); GatekeeperAWSInstance awsInstance7 = new GatekeeperAWSInstance(instanceId, application, name, ip,platform2); Assert.assertEquals("Test Equals on self", awsInstance1, awsInstance1); Assert.assertNotEquals("Test Equals on different object", awsInstance1, new ArrayList()); Assert.assertEquals("Test Equals on 2 different, but equal objects", awsInstance1, awsInstance2); Assert.assertNotEquals("Test Equals on different ID", awsInstance1, awsInstance3); Assert.assertNotEquals("Test Equals on different Application", awsInstance1, awsInstance4); Assert.assertNotEquals("Test Equals on different Name", awsInstance1, awsInstance5); Assert.assertNotEquals("Test Equals on different IP", awsInstance1, awsInstance6); Assert.assertNotEquals("Test Equals on different Platform", awsInstance1, awsInstance7); }