### Question:
ChannelDTO implements Serializable { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final ChannelDTO other = (ChannelDTO) obj; return channelId == null ? other.channelId == null : channelId.equals(other.channelId) && endpointToken == null ? other.endpointToken == null : endpointToken.equals(other.endpointToken); } protected  ChannelDTO();  ChannelDTO(final UserAgentDTO userAgent, final String channelId, final long version, final String endpointToken); String getChannelId(); long getVersion(); void setVersion(final long version); String getEndpointToken(); UserAgentDTO getUserAgent(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj);  }### Answer:
@Test public void equalsContractReflexive() { final ChannelDTO x = new ChannelDTO(new UserAgentDTO(uaid), channelId, version, endpointUrl); assertThat(x.equals(x), is(true)); }
@Test public void equalsContractSymmetric() { final ChannelDTO x = new ChannelDTO(new UserAgentDTO(uaid), channelId, version, endpointUrl); final ChannelDTO y = new ChannelDTO(new UserAgentDTO(uaid), channelId, version, endpointUrl); assertThat(x.equals(y), is(true)); assertThat(y.equals(x), is(true)); }
@Test public void equalsContractTransative() { final ChannelDTO x = new ChannelDTO(new UserAgentDTO(uaid), channelId, version, endpointUrl); final ChannelDTO y = new ChannelDTO(new UserAgentDTO(uaid), channelId, version, endpointUrl); final ChannelDTO z = new ChannelDTO(new UserAgentDTO(uaid), channelId, version, endpointUrl); assertThat(x.equals(y), is(true)); assertThat(y.equals(z), is(true)); assertThat(x.equals(z), is(true)); }
@Test public void equalsContractNull() { final ChannelDTO x = new ChannelDTO(new UserAgentDTO(uaid), channelId, version, endpointUrl); assertThat(x.equals(null), is(false)); }