NobtLinkFactory implements LinkFactory<Nobt> { @Override public URI createLinkTo(Nobt nobt) { return URI.create(String.format("%s/nobts/%s", basePath.asString(), nobt.getId().getValue())); } NobtLinkFactory(BasePath basePath); @Override URI createLinkTo(Nobt nobt);  }
@Test public void shouldCreateUri() { final NobtLinkFactory nobtLinkFactory = new NobtLinkFactory(new BasePath("http", "localhost:1234")); final Nobt nobt = aNobt().withId(new NobtId("foo")).build(); final URI linkToNobt = nobtLinkFactory.createLinkTo(nobt); Assert.assertEquals("http: }