### Question:
SplitQueryStringOfRequest implements HttpRequestToTestCaseStepConverter { @Override public Optional<Map<String, String>> convert(HttpRequest httpRequest) throws MalformedURLException, UnsupportedEncodingException { Map<String, String> rawMap = URLUtils.splitQuery(new URL(httpRequest.getUri())); return Optional.of(rawMap); }  @Override Optional<Map<String, String>> convert(HttpRequest httpRequest);  }### Answer:
@Test public void canSplitQuery() throws MalformedURLException, UnsupportedEncodingException { URL url = new URL("http: HttpRequest httpRequest = mock(HttpRequest.class); when(httpRequest.getUri()).thenReturn(url.toString()); SplitQueryStringOfRequest splitQueryStringOfRequest = new SplitQueryStringOfRequest(); Optional<Map<String, String>> parametersOptional = splitQueryStringOfRequest.convert(httpRequest); assertTrue(parametersOptional.isPresent()); Map<String, String> parameters = parametersOptional.get(); assertTrue(parameters.containsKey("key1")); assertEquals("value1", parameters.get("key1")); assertTrue(parameters.containsKey("key2")); assertEquals("value2", parameters.get("key2")); }