### Question:
DefaultChannel implements Channel { @Override public int hashCode() { int result = 1; result = 31 * result + ((channelId == null) ? 0 : channelId.hashCode()); result = 31 * result + ((endpointToken == null) ? 0 : endpointToken.hashCode()); result = 31 * result + (int) (version ^ (version >>> 32)); return result; } DefaultChannel(final String uaid, final String channelId, final String endpointToken);  DefaultChannel(final String uaid, final String channelId, final long version, final String endpointToken); @Override String getUAID(); @Override String getChannelId(); @Override long getVersion(); @Override String getEndpointToken(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj);  }### Answer:
@Test public void equalsContractSymetric() { final Channel x = new DefaultChannel("test", "123abc", 1, "33ddd2elaeee"); final Channel y = new DefaultChannel("test", "123abc", 1, "33ddd2elaeee"); assertThat(x, equalTo(y)); assertThat(y, equalTo(x)); assertThat(x.hashCode(), equalTo(y.hashCode())); }
@Test public void equalsContractTransitive() { final Channel x = new DefaultChannel("test", "123abc", 1, "33ddd2elaeee"); final Channel y = new DefaultChannel("test", "123abc", 1, "33ddd2elaeee"); final Channel z = new DefaultChannel("test", "123abc", 1, "33ddd2elaeee"); assertThat(x, equalTo(y)); assertThat(y, equalTo(z)); assertThat(x, equalTo(z)); assertThat(x.hashCode(), equalTo(z.hashCode())); }