### Question:
ServiceMappedAddressFunctionProcessor extends ServiceRegistryFunctionProcessorBase<ServiceMappedAddressFunctionDescriptor> implements UrlRewriteFunctionProcessor<ServiceMappedAddressFunctionDescriptor> { @Override public List<String> resolve( UrlRewriteContext context, List<String> parameters ) throws Exception { List<String> results = null; if( parameters != null ) { UrlRewriter.Direction direction = context.getDirection(); results = new ArrayList<>( parameters.size() ); for( String parameter : parameters ) { parameter = resolve( direction, parameter ); results.add( parameter ); } } return results; }  @Override String name(); @Override void initialize( UrlRewriteEnvironment environment, ServiceMappedAddressFunctionDescriptor descriptor ); @Override List<String> resolve( UrlRewriteContext context, List<String> parameters ); String resolve( UrlRewriter.Direction direction, String parameter );  }### Answer:
@Test public void testResolve() throws Exception { ServiceMappedAddressFunctionProcessor func = new ServiceMappedAddressFunctionProcessor(); func.initialize( env, desc ); assertThat( func.resolve( ctx, Collections.singletonList("test-service")), contains( "test-internal-host:777" ) ); assertThat( func.resolve( ctx, Collections.singletonList("invalid-test-service")), contains( "invalid-test-service" ) ); assertThat( func.resolve( ctx, null ), nullValue() ); func.destroy(); }