### Question:
InboundUrlFunctionDescriptor implements UrlRewriteFunctionDescriptor<InboundUrlFunctionDescriptor> { @Override public String name() { return FUNCTION_NAME; }  @Override String name(); static final String FUNCTION_NAME; }### Answer:
@Test public void testServiceLoader() throws Exception { ServiceLoader loader = ServiceLoader.load( UrlRewriteFunctionDescriptor.class ); Iterator iterator = loader.iterator(); assertThat( "Service iterator empty.", iterator.hasNext() ); while( iterator.hasNext() ) { Object object = iterator.next(); if( object instanceof InboundUrlFunctionDescriptor ) { String name = ((InboundUrlFunctionDescriptor)object).name(); assertThat( name, is("inboundurl")); return; } } fail( "Failed to find " + InboundUrlFunctionDescriptor.class.getName() + " via service loader." ); }