### Question:
DirectoryV3DevicesListPostResponse { @Override public int hashCode() { return getDevices() != null ? getDevices().hashCode() : 0; } DirectoryV3DevicesListPostResponse(List<DirectoryV3DevicesListPostResponseDevice> devices); List<DirectoryV3DevicesListPostResponseDevice> getDevices(); @Override boolean equals(Object o); @Override String toString(); @Override int hashCode();  }### Answer:
@Test public void hashCodeForEqualObjectsIsEqual() throws Exception { DirectoryV3DevicesListPostResponseDevice device = new DirectoryV3DevicesListPostResponseDevice(UUID.randomUUID(), "name", "type", 0, null, null); assertEquals( new DirectoryV3DevicesListPostResponse(Collections.singletonList(device)).hashCode(), new DirectoryV3DevicesListPostResponse(Collections.singletonList(device)).hashCode() ); }
@Test public void hashCodeForUnequalObjectsIsNotEqual() throws Exception { assertNotEquals( new DirectoryV3DevicesListPostResponse(Collections.singletonList( new DirectoryV3DevicesListPostResponseDevice(UUID.randomUUID(), "name", "type", 0, null, null) )).hashCode(), new DirectoryV3DevicesListPostResponse(Collections.singletonList( new DirectoryV3DevicesListPostResponseDevice(UUID.randomUUID(), "name", "type", 0, null, null) )).hashCode() ); }