    @Test
    public void testValidate() {

        assertTrue(true);
        Validator<String> v = new HostNameValidator(true);
        // Problems p = new Problems();

        assertNull(check(v, "www.foo.com"));
        assertNull(check(v, "www.foo.com:8080"));
        //test AIOOBE
        assertTrue(check(v,  "bar.com ").isFatal());
        assertTrue(check(v,  " bar.com").isFatal());
        assertTrue(check(v,  ":").isFatal());

        v = new HostNameValidator(false);
        assertTrue(check(v,  "myhost.com:204").isFatal());
        assertTrue(check(v,  "myhost.com:204-").isFatal());

        v = new HostNameValidator(true);
        assertTrue(check(v,  "128.foo.129").isFatal());
        assertTrue(check(v,  "128.foo.129:1024").isFatal());
        assertTrue(check(v,  "www.foo.com:abcd").isFatal());
        assertTrue(check(v,  "foo.").isFatal());
        assertTrue(check(v,  "128.").isFatal());
        assertNull(check(v,  "www.foo-bar.com"));
        assertTrue(check(v,  "www.foo-bar.com-").isFatal());
        assertTrue(check(v,  "-www.foo-bar.com").isFatal());
        assertTrue(check(v,  "www.foo-bar.com ").isFatal());
        assertTrue(check(v,  " www.foo-bar.com").isFatal());
        assertTrue(check(v,  "204.128").isFatal());

        assertTrue(check(v,  "foo@bar.com").isFatal());
        assertTrue(check(v,  "foo.бar.com").isFatal());
        assertTrue(check(v,  "фу.бар.ком").isFatal());
        assertTrue(check(v,  "myhost:").isFatal());
        assertTrue(check(v,  "myhost::").isFatal());
        assertTrue(check(v,  "www.foo.com::2040").isFatal());
        assertTrue(check(v,  "www.foo.com:2040802").isFatal());
        assertTrue(check(v,  "www.foo.com:2040:2802").isFatal());
        assertTrue(check(v,  "www.foo.com:2040:").isFatal());
        assertTrue(check(v,  "www..foo.com").isFatal());
    }