@Test public void testWithValidResource() { Function<Object, URI> function = new UriForResource(); Resource res = Resource.builder().name("test").url(URI.create("http: URI result = function.apply(res); assertEquals(res.getUrl().toString(), result.toString()); }
@Override public URI apply(Object input) { checkArgument(checkNotNull(input, "input") instanceof Resource, "This function can only be applied to Resource objects"); return ((Resource) input).getUrl(); }
UriForResource implements Function<Object, URI> { @Override public URI apply(Object input) { checkArgument(checkNotNull(input, "input") instanceof Resource, "This function can only be applied to Resource objects"); return ((Resource) input).getUrl(); } }
UriForResource implements Function<Object, URI> { @Override public URI apply(Object input) { checkArgument(checkNotNull(input, "input") instanceof Resource, "This function can only be applied to Resource objects"); return ((Resource) input).getUrl(); }  }
UriForResource implements Function<Object, URI> { @Override public URI apply(Object input) { checkArgument(checkNotNull(input, "input") instanceof Resource, "This function can only be applied to Resource objects"); return ((Resource) input).getUrl(); }  @Override URI apply(Object input); }
UriForResource implements Function<Object, URI> { @Override public URI apply(Object input) { checkArgument(checkNotNull(input, "input") instanceof Resource, "This function can only be applied to Resource objects"); return ((Resource) input).getUrl(); }  @Override URI apply(Object input);  }