@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())); }
@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 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 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); }
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); }
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);  }