### Question:
Sanetizer { public static String checkForUrlPathPattern(String input, int maxLength) { if(input == null || input.trim().length() == 0) { return ""; } if(urlPathPattern.matcher(input).matches()){ if(maxLength == 0) { return input; } else { return input.length() <= maxLength ? input : input.substring(0, maxLength); } } else { LOGGER.warning(String.format("The given URL path is invalid! URL path: '%s', max length: '%d'", input, maxLength)); return ("The given URL path is invalid! Please correct it!"); } }  static String sanetize(String input); static String sanetize(String input, int maxLength); static String checkForUrlPattern(String input, int maxLength); static String checkForUrlPathPattern(String input, int maxLength);  }### Answer:
@Test public void testSanetizeUrlPathPattern() { String urlPath = "../html5shiv/3.7.3/html5shiv.min.js"; assertEquals(urlPath, Sanetizer.checkForUrlPathPattern(urlPath, 256)); }
@Test public void testSanetizeUrlPathPatternShortened() { String urlPath = "../html5shiv/3.7.3/html5shiv.min.js"; assertEquals("../html5shiv/3.7", Sanetizer.checkForUrlPathPattern(urlPath, 16)); }
@Test public void testSanetizeUrlPathPatternAbsolute() { String urlPath = "/html5shiv/3.7.3/html5shiv.min.js"; assertEquals(urlPath, Sanetizer.checkForUrlPathPattern(urlPath, 256)); }