@Test
    public void testFileURIEmptyHost() {
        URI uri = new URI("file:///C:/Inetpub/wwwroot/DW_SHORTCUTS.htm");
        List<URI.Token> tokens = uri.tokenize();
        URI.Token token;
        token = tokens.get(0);
        assertEquals("file", token.getToken());
        assertEquals(URI.URLContext.URL_SCHEME, token.getContext());

        token = tokens.get(1);
        assertEquals("localhost", token.getToken());
        assertEquals(URI.URLContext.URL_HOST, token.getContext());

        token = tokens.get(2);
        assertEquals("C", token.getToken());
        assertEquals(URI.URLContext.URL_PATH, token.getContext());

        token = tokens.get(3);
        assertEquals("Inetpub", token.getToken());
        assertEquals(URI.URLContext.URL_PATH, token.getContext());

        token = tokens.get(4);
        assertEquals("wwwroot", token.getToken());
        assertEquals(URI.URLContext.URL_PATH, token.getContext());

        token = tokens.get(5);
        assertEquals("DW_SHORTCUTS", token.getToken());
        assertEquals(URI.URLContext.URL_PATH, token.getContext());

        token = tokens.get(6);
        assertEquals("htm", token.getToken());
        assertEquals(URI.URLContext.URL_PATH, token.getContext());

        try {
            tokens.get(7);
            fail();
        } catch (IndexOutOfBoundsException ioobe) {
            // Success
        }
    }
Tests the URI class

@author bratseth
vespajlib/src/test/java/com/yahoo/net/URITestCase.java