### Question:
DirectoryV3DevicesPostRequest { @Override public int hashCode() { return Objects.hash(getIdentifier(), getTTL()); } DirectoryV3DevicesPostRequest(String identifier, Integer ttl); @JsonProperty("identifier") String getIdentifier(); @JsonProperty("ttl") @JsonInclude(JsonInclude.Include.NON_EMPTY) Integer getTTL(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); final String identifier; }### Answer:
@Test public void hashCodeEqualForEquivalentObjects() { assertEquals(new DirectoryV3DevicesPostRequest("expected identifier", 999).hashCode(), request.hashCode()); }
@Test public void hashCodeDifferentForDifferentIdentifiers() { assertNotEquals(new DirectoryV3DevicesPostRequest("different", 999).hashCode(), request.hashCode()); }
@Test public void hashCodeDifferentForDifferentTtl() { assertNotEquals(new DirectoryV3DevicesPostRequest("expected identifier", 998).hashCode(), request.hashCode()); }