LinkToGene implements Function<P, URI> { @Override public URI apply(P profile) { try { return new URI("genes/" + profile.getId()); } catch (URISyntaxException e) { throw new RuntimeException(e); } }  @Override URI apply(P profile);  }
@Test public void linksAtNoSpecificTab() { assertThat(subject.apply(new DummyProfile("geneId", "geneName")).toString(), endsWith("geneId")); }
@Test public void uriSyntaxExceptionsAreWrapped() { for (String illegalChar: ILLEGAL_CHARS) { try { subject.apply(new DummyProfile(illegalChar, "")); fail("Did not throw:" + illegalChar); } catch (RuntimeException e) { } } }