DefaultWorldpayURIService implements WorldpayURIService { protected List<NameValuePair> extractParametersFromUrl(final String redirectUrl) throws WorldpayException { try { URIBuilder uriBuilder = new URIBuilder(redirectUrl); return uriBuilder.getQueryParams(); } catch (URISyntaxException e) { LOG.error(MessageFormat.format(UNABLE_TO_PARSE_URL, redirectUrl), e); throw new WorldpayException(UNABLE_TO_PARSE_URL_REDIRECT_URL, e); } }  @Override void extractUrlParamsToMap(final String redirectReferenceUrl, final Map<String, String> params);  }
@Test public void extractParametersFromUrl() throws WorldpayException { final List<NameValuePair> result = testObj.extractParametersFromUrl(REDIRECT_URL); assertNotNull(result); assertEquals("key", result.get(0).getName()); assertEquals("val", result.get(0).getValue()); assertEquals("key2", result.get(1).getName()); assertEquals("val2", result.get(1).getValue()); }