### Question:
ServiceSchemeFunctionProcessor extends ServiceRegistryFunctionProcessorBase<ServiceSchemeFunctionDescriptor> implements UrlRewriteFunctionProcessor<ServiceSchemeFunctionDescriptor> { @Override public List<String> resolve( UrlRewriteContext context, List<String> parameters ) throws Exception { List<String> results = null; if( parameters != null ) { results = new ArrayList<>( parameters.size() ); for( String parameter : parameters ) { String url = lookupServiceUrl( parameter ); if( url != null && !url.equals( parameter ) ) { Template template = Parser.parseLiteral( url ); Scheme scheme = template.getScheme(); if( scheme != null ) { parameter = scheme.getFirstValue().getPattern(); } } results.add( parameter ); } } return results; }  @Override String name(); @Override List<String> resolve( UrlRewriteContext context, List<String> parameters );  }### Answer:
@Test public void testResolve() throws Exception { ServiceSchemeFunctionProcessor func = new ServiceSchemeFunctionProcessor(); func.initialize( env, desc ); assertThat( func.resolve( ctx, Collections.singletonList("test-service")), contains( "test-scheme" ) ); assertThat( func.resolve( ctx, Collections.singletonList("invalid-test-service")), contains( "invalid-test-service" ) ); assertThat( func.resolve( ctx, null ), nullValue() ); func.destroy(); }