### Question:
LinkService { public <E extends LinkableEntity> void populateFullLinks(final E entity, final URI baseUri) { final LinkBuilder linkBuilder = LINK_BUILDERS.get(entity.getClass()); if (linkBuilder == null) { throw new IllegalArgumentException("No LinkBuilder found for " + entity.getClass().getCanonicalName()); } if (baseUri == null) { throw new IllegalArgumentException("Base URI cannot be null"); } final Link relativeLink = linkBuilder.createLink(entity); final Link fullLink = getFullLink(baseUri, relativeLink); entity.setLink(fullLink); if (entity instanceof LinkableDocs) { final LinkBuilder docsLinkBuilder = DOCS_LINK_BUILDERS.get(entity.getClass()); if (docsLinkBuilder == null) { throw new IllegalArgumentException("No documentation LinkBuilder found for " + entity.getClass().getCanonicalName()); } final Link relativeDocsLink = docsLinkBuilder.createLink(entity); final Link fullDocsLink = getFullLink(baseUri, relativeDocsLink); final LinkableDocs docsEntity = (LinkableDocs) entity; docsEntity.setLinkDocs(fullDocsLink); } }  void populateLinks(final E entity); void populateLinks(final Iterable<E> entities); void populateFullLinks(final E entity, final URI baseUri); void populateFullLinks(final Iterable<E> entities, final URI baseUri);  }### Answer:
@Test public void testPopulateExtensionRepoVersionFullLinks() { extensionRepoVersions.forEach(i -> Assert.assertNull(i.getLink())); linkService.populateFullLinks(extensionRepoVersions, baseUri); extensionRepoVersions.forEach(i -> { Assert.assertEquals( BASE_URI + "/extension-repository/" + i.getBucketName() + "/" + i.getGroupId() + "/" + i.getArtifactId() + "/" + i.getVersion(), i.getLink().getUri().toString()); } ); }
@Test public void testPopulateExtensionRepoExtensionMetdataFullLinks() { extensionRepoExtensionMetadata.forEach(i -> Assert.assertNull(i.getLink())); extensionRepoExtensionMetadata.forEach(i -> Assert.assertNull(i.getLinkDocs())); linkService.populateFullLinks(extensionRepoExtensionMetadata, baseUri); extensionRepoExtensionMetadata.forEach(i -> { final BundleInfo bi = i.getExtensionMetadata().getBundleInfo(); final String extensionUri = BASE_URI + "/extension-repository/" + bi.getBucketName() + "/" + bi.getGroupId() + "/" + bi.getArtifactId() + "/" + bi.getVersion() + "/extensions/" + i.getExtensionMetadata().getName(); Assert.assertEquals(extensionUri, i.getLink().getUri().toString()); Assert.assertEquals(extensionUri + "/docs", i.getLinkDocs().getUri().toString()); }); }