ServiceCoordinate { @Override public int hashCode() { int result = region.hashCode(); result = 31 * result + tag.hashCode(); result = 31 * result + service.hashCode(); return result; } ServiceCoordinate(final CloudnamePath path); String getRegion(); String getTag(); String getService(); static ServiceCoordinate parse(final String serviceCoordinateString); @Override boolean equals(final Object otherInstance); @Override int hashCode();  }
@Test public void testHashCode() { final ServiceCoordinate coordA = ServiceCoordinate.parse("a.b.c"); final ServiceCoordinate coordB = ServiceCoordinate.parse("a.b.c"); final ServiceCoordinate coordC = ServiceCoordinate.parse("x.x.x"); assertThat(coordA.hashCode(), is(coordB.hashCode())); assertThat(coordC.hashCode(), is(not(coordA.hashCode()))); }