### Question:
QueryStringValidator implements URLValidator { @Override public boolean validate(URI url) { String queryString = url.getQuery(); if (queryString != null && !queryString.isEmpty()) { queryString = queryString.replaceAll(">", "").replaceAll("<", ""); for (AbstractBlacklistStrategy abstractBlacklistStrategy : validationStrategyList) { if (!abstractBlacklistStrategy.isValid("", queryString)) { return false; } } } return true; }  @Override boolean validate(URI url);  }### Answer:
@Test public void testInvalidQueryString() throws URISyntaxException { assertFalse("Should not validate", queryStringValidator.validate(new URI("http: }
@Test public void testValidQueryString() throws URISyntaxException, UnsupportedEncodingException { assertTrue("Should validate", queryStringValidator.validate(new URI("http: assertTrue("Should validate", queryStringValidator.validate(new URI("http: + URLEncoder.encode("key<value", "UTF-8")))); assertTrue("Should validate", queryStringValidator.validate(new URI("http: + URLEncoder.encode("key>value", "UTF-8")))); }