Endpoint { @Override public int hashCode() { if (comparisonString != null) { return comparisonString.hashCode(); } else { return 0; } } Endpoint(String url); String getURL(); EndpointType getType(); String getComparisonString(); URL generateGetCapabilitiesURL(); boolean equals(Endpoint other); @Override int hashCode(); @Override boolean equals(Object obj);  }
@Test public void testHashCode() { String url = "http: Endpoint instance = new Endpoint(url); int expResult = 1494733094; int result = instance.hashCode(); assertThat(expResult, is(equalTo(result))); }