### Question:
ServiceV3AuthsPostRequest { @Override public int hashCode() { return Objects.hash(getUsername(), getPolicy(), getContext(), getTitle(), getTTL(), getPushTitle(), getPushBody(), getDenialReasons()); } ServiceV3AuthsPostRequest(String username, AuthPolicy policy, String context, String title, Integer ttl,
                                     String pushTitle, String pushBody, List<DenialReason> denialReasons); @Deprecated  ServiceV3AuthsPostRequest(String username, AuthPolicy policy, String context); @JsonProperty("username") String getUsername(); @JsonProperty("policy") AuthPolicy getPolicy(); @JsonProperty("context") String getContext(); @JsonProperty("title") String getTitle(); @JsonProperty("ttl") Integer getTTL(); @JsonProperty("push_title") String getPushTitle(); @JsonProperty("push_body") String getPushBody(); @JsonProperty("denial_reasons") @JsonInclude(JsonInclude.Include.NON_EMPTY) List<DenialReason> getDenialReasons(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void hashCodeIsSameForEquivalent() { AuthPolicy policy = new AuthPolicy((Integer) null, null, null, null, null); List<DenialReason> reasons = new ArrayList<DenialReason>(){{ add(new DenialReason("1", "a", true)); }}; assertEquals( new ServiceV3AuthsPostRequest("A", policy, "C", "T", 1, "PT", "PB", reasons).hashCode(), new ServiceV3AuthsPostRequest("A", policy, "C", "T", 1, "PT", "PB", reasons).hashCode() ); }
@Test public void hashCodeNotSameForNotEquivalent() { AuthPolicy policy = new AuthPolicy((Integer) null, null, null, null, null); List<DenialReason> reasons = new ArrayList<DenialReason>(){{ add(new DenialReason("1", "a", true)); }}; assertNotEquals( new ServiceV3AuthsPostRequest("A", policy, "C", "T", 1, "PT", "PB", reasons).hashCode(), new ServiceV3AuthsPostRequest("B", policy, "D", "U", 2, "PU", "PC", reasons).hashCode() ); }
@Test public void hashCodeNotSameForNotEquivalentPushTitle() { AuthPolicy policy = new AuthPolicy((Integer) null, null, null, null, null); List<DenialReason> reasons = new ArrayList<DenialReason>(){{ add(new DenialReason("1", "a", true)); }}; assertNotEquals( new ServiceV3AuthsPostRequest("A", policy, "C", "T", 1, "PT", "PB", reasons).hashCode(), new ServiceV3AuthsPostRequest("A", policy, "C", "T", 1, "PU", "PB", reasons).hashCode() ); }
@Test public void hashCodeNotSameForNotEquivalentPushBody() { AuthPolicy policy = new AuthPolicy((Integer) null, null, null, null, null); List<DenialReason> reasons = new ArrayList<DenialReason>(){{ add(new DenialReason("1", "a", true)); }}; assertNotEquals( new ServiceV3AuthsPostRequest("A", policy, "C", "T", 1, "PT", "PB", reasons).hashCode(), new ServiceV3AuthsPostRequest("A", policy, "C", "T", 1, "PT", "PC", reasons).hashCode() ); }
@Test public void hashCodeNotSameForNotEquivalentDenialReasons() { AuthPolicy policy = new AuthPolicy((Integer) null, null, null, null, null); List<DenialReason> leftReasons = new ArrayList<DenialReason>(){{ add(new DenialReason("1", "a", true)); }}; List<DenialReason> rightReasons = new ArrayList<DenialReason>(){{ add(new DenialReason("2", "b", false)); }}; assertNotEquals( new ServiceV3AuthsPostRequest("A", policy, "C", "T", 1, "PT", "PB", leftReasons).hashCode(), new ServiceV3AuthsPostRequest("A", policy, "C", "T", 1, "PT", "PB", rightReasons).hashCode() ); }