@Test
public void testEncodeValidationSuccess() throws Exception {

  @SuppressWarnings("unchecked")
  RequestParamsExtractor<Integer> extractor =
      getMockExtractor(2, ImmutableMap.of("param1", "value+1", "param2", "value+2+%26"));
  RequestUrlParamsEncoder<Integer> encoder = new RequestUrlParamsEncoder<>(extractor, true);
  String encodedParams = encoder.encode(2);
  assertEquals("param1=value+1&param2=value+2+%26", encodedParams);
}