@Test
public void testExecute() throws Exception {

    UrlValidator validator = new UrlValidator();
    assertEquals(false, validator.execute(""));
    assertEquals(false, validator.execute(" "));
    assertEquals(false, validator.execute(null));
    assertEquals(true, validator.execute("http://www.foo.com/to/page.cfm?a=1&b=2#bar"));
    assertEquals(true, validator.execute("https://www.foo.com/to/page.cfm?a=1&b=2#bar"));
    assertEquals(true, validator.execute("/to/page.cfm?a=1&b=2#bar"));
    assertEquals(true, validator.execute("/to/page.cfm?a=%00%foo&b=2#bar"));
    assertEquals(false, validator.execute("/to/page.cfm?a=ü&b=2#bar"));
    assertEquals(false, validator.execute("https://www.foo.com/to/page.cfm?a=ü&b=2#bar"));
    assertEquals(false, validator.execute("https://www.foo.com/to/page.cfm?a=ü&b=2#bar"));
}