### Question:
ConstraintReportId implements Serializable { private ConstraintReportId() { } private  ConstraintReportId(); private  ConstraintReportId(ResourceId resourceId, String failureId); ResourceId resourceId(); String failureId(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); static ConstraintReportId create(ResourceId resourceId, String failureId);  }### Answer:
@Test public void testEqualOnlyToOtherIds() { ConstraintReportId id = constraintReportId("name", "failureId"); assertThat((Object)id,not(equalTo((Object)"another type"))); }
@Test public void testEqualToSelf() { ConstraintReportId id = constraintReportId("name", "failureId"); assertThat(id,equalTo(id)); }
@Test public void testEqual() { ConstraintReportId id1 = constraintReportId("name", "failureId"); ConstraintReportId id2 = constraintReportId("name", "failureId"); assertThat(id1,equalTo(id2)); }
@Test public void testEqualWithDifferentReportIds() { ConstraintReportId id1 = constraintReportId("name1", "failureId"); ConstraintReportId id2 = constraintReportId("name2", "failureId"); assertThat(id1,not(equalTo(id2))); }
@Test public void testEqualWithDifferentFailureIds() { ConstraintReportId id1 = constraintReportId("name", "failureId1"); ConstraintReportId id2 = constraintReportId("name", "failureId2"); assertThat(id1,not(equalTo(id2))); }
@Test public void testEqualWithDifferentIds() { ConstraintReportId id1 = constraintReportId("name1", "failureId1"); ConstraintReportId id2 = constraintReportId("name2", "failureId2"); assertThat(id1,not(equalTo(id2))); }