### Question:
FailsafeElement { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null || getClass() != obj.getClass()) { return false; } final FailsafeElement other = (FailsafeElement) obj; return Objects.deepEquals(this.originalPayload, other.getOriginalPayload()) && Objects.deepEquals(this.payload, other.getPayload()) && Objects.deepEquals(this.errorMessage, other.getErrorMessage()) && Objects.deepEquals(this.stacktrace, other.getStacktrace()); } private  FailsafeElement(OriginalT originalPayload, CurrentT payload); static FailsafeElement<OriginalT, CurrentT> of(
      OriginalT originalPayload, CurrentT currentPayload); static FailsafeElement<OriginalT, CurrentT> of(
      FailsafeElement<OriginalT, CurrentT> other); OriginalT getOriginalPayload(); CurrentT getPayload(); String getErrorMessage(); FailsafeElement<OriginalT, CurrentT> setErrorMessage(String errorMessage); String getStacktrace(); FailsafeElement<OriginalT, CurrentT> setStacktrace(String stacktrace); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void testEquals() { FailsafeElement<String, Integer> element = FailsafeElement.of("answer", 42) .setErrorMessage("failed!") .setStacktrace("com.google..."); assertThat( element, is( equalTo( FailsafeElement.of("answer", 42) .setErrorMessage("failed!") .setStacktrace("com.google...")))); assertThat( element, is( not( equalTo( FailsafeElement.of("answer", 1) .setErrorMessage("failed!") .setStacktrace("com.google..."))))); assertThat(element, is(equalTo(FailsafeElement.of(element)))); }