### Question:
UrlRewriteContextImpl implements UrlRewriteContext { @Override public Params getParameters() { return params; } UrlRewriteContextImpl(
      UrlRewriteEnvironment environment,
      Resolver resolver,
      Map<String,UrlRewriteFunctionProcessor> functions,
      UrlRewriter.Direction direction,
      Template url ); @Override UrlRewriter.Direction getDirection(); @Override Template getOriginalUrl(); @Override Template getCurrentUrl(); @Override void setCurrentUrl( Template url ); @Override void addParameters( Params parameters ); @Override Params getParameters(); @Override Evaluator getEvaluator();  }### Answer:
@Test public void testResolve() throws Exception { UrlRewriteEnvironment environment = EasyMock.createNiceMock( UrlRewriteEnvironment.class ); EasyMock.expect( environment.resolve( "test-env-param-name" ) ).andReturn(Collections.singletonList("test-env-param-value")).anyTimes(); Resolver resolver = EasyMock.createNiceMock( Resolver.class ); EasyMock.expect( resolver.resolve( "test-ctx-param-name" ) ).andReturn(Collections.singletonList("test-ctx-param-value")); EasyMock.replay( environment, resolver ); Map<String,UrlRewriteFunctionProcessor> functions = new HashMap<>(); UrlRewriter.Direction direction = UrlRewriter.Direction.OUT; Template template = Parser.parseLiteral( "scheme: UrlRewriteContextImpl context = new UrlRewriteContextImpl( environment, resolver, functions, direction, template ); Params params = context.getParameters(); List<String> values = params.resolve( "test-env-param-name" ); assertThat( values, notNullValue() ); assertThat( values.size(), is( 1 ) ); assertThat( values.get( 0 ), is( "test-env-param-value" ) ); values = params.resolve( "test-ctx-param-name" ); assertThat( values, notNullValue() ); assertThat( values.size(), is( 1 ) ); assertThat( values.get( 0 ), is( "test-ctx-param-value" ) ); }