@Test
public void testCreation() {

    final Endpoint ep1 = new Endpoint("foo", "bar", 1);
    final Endpoint ep2 = new Endpoint("bar", "baz", 1);
    final ServiceData data = new ServiceData(Arrays.asList(ep1, ep2));
    assertThat(data.getEndpoint("foo"), is(equalTo(ep1)));
    assertThat(data.getEndpoint("bar"), is(equalTo(ep2)));
    assertThat(data.getEndpoint("baz"), is(nullValue()));
}