MessageOptions { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof MessageOptions)) { return false; } MessageOptions other = (MessageOptions) obj; return Objects.equals(this.subject, other.subject) && Objects.equals(this.bodyHtml, other.bodyHtml) && Objects.equals(this.bodyText, other.bodyText) && Objects.equals(this.bodyHtmlUrlPlaceholder, other.bodyHtmlUrlPlaceholder) && Objects.equals(this.bodyTextUrlPlaceholder, other.bodyTextUrlPlaceholder) && Objects.equals(this.successHtml, other.successHtml); } MessageOptions(@JsonProperty("subject") String subject,
                        @JsonProperty("bodyHtmlFile") String bodyHtml,
                        @JsonProperty("bodyTextFile") String bodyText,
                        @JsonProperty("bodyHtmlUrlPlaceholder") String bodyHtmlUrlPlaceholder,
                        @JsonProperty("bodyTextUrlPlaceholder") String bodyTextUrlPlaceholder,
                        @JsonProperty("successHtmlFile") String successHtml); String getSubject(); String getBodyHtml(); String getBodyText(); String getBodyHtmlUrlPlaceholder(); String getBodyTextUrlPlaceholder(); String getSuccessHtml(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString();  }
@Test @SuppressWarnings({"ConstantConditions", "ObjectEqualsNull"}) void testEquals() { MessageOptions messageOptions = new MessageOptions("subject", "bodyHtml", "bodyText", "htmlPlaceholder", "textPlaceholder", "successHtml"); assertAll("Basic equals properties", () -> assertTrue(!messageOptions.equals(null), "MessageOptions must not be equal to null"), () -> assertTrue(!messageOptions.equals(new Object()), "MessageOptions must not be equal to another type"), () -> assertEquals(messageOptions, messageOptions, "MessageOptions must be equal to itself")); MessageOptions differentSubject = new MessageOptions("badSubject", "bodyHtml", "bodyText", "htmlPlaceholder", "textPlaceholder", "successHtml"); MessageOptions differentBodyHtml = new MessageOptions("subject", "badBodyHtml", "bodyText", "htmlPlaceholder", "textPlaceholder", "successHtml"); MessageOptions differentBodyText = new MessageOptions("subject", "bodyHtml", "badBodyText", "htmlPlaceholder", "textPlaceholder", "successHtml"); MessageOptions differentHtmlPlaceholder = new MessageOptions("subject", "bodyHtml", "bodyText", "badHtmlPlaceholder", "textPlaceholder", "successHtml"); MessageOptions differentTextPlaceholder = new MessageOptions("subject", "bodyHtml", "bodyText", "htmlPlaceholder", "badTextPlaceholder", "successHtml"); MessageOptions differentSuccessHtml = new MessageOptions("subject", "bodyHtml", "bodyText", "htmlPlaceholder", "textPlaceholder", "badSuccessHtml"); MessageOptions sameMessageOptions = new MessageOptions("subject", "bodyHtml", "bodyText", "htmlPlaceholder", "textPlaceholder", "successHtml"); assertAll("Verify against other created objects", () -> assertNotEquals(differentSubject, messageOptions), () -> assertNotEquals(differentBodyHtml, messageOptions), () -> assertNotEquals(differentBodyText, messageOptions), () -> assertNotEquals(differentHtmlPlaceholder, messageOptions), () -> assertNotEquals(differentTextPlaceholder, messageOptions), () -> assertNotEquals(differentSuccessHtml, messageOptions), () -> assertEquals(sameMessageOptions, messageOptions)); }