static URITypes findURIType(final StringReader reader) {
        final StringReader copy = reader.copy();
        if(!copy.endOfString()) {
            char c = (char) copy.read();
            if(c == '/') {
                reader.skip(1);
                if(!copy.endOfString()) {
                    c = (char) copy.read();
                    if(c == '/') {
                        reader.skip(1);
                        return URITypes.Authority;
                    }
                    reader.skip(-1);
                }
                return URITypes.Absolute;
            }
            return URITypes.Rootless;
        }
        return URITypes.Undefined;
    }
@Test
    public void testFindUriType() {
        final Map<String, HostParser.URITypes> tests = ImmutableMap.<String, HostParser.URITypes>builder()
            .put("/path", HostParser.URITypes.Absolute)
            .put("user@domain/path", HostParser.URITypes.Rootless)
            .put("//user@domain.tld:port/path", HostParser.URITypes.Authority)
            .put("", HostParser.URITypes.Undefined).build();
        for(Map.Entry<String, HostParser.URITypes> entry : tests.entrySet()) {
            final HostParser.StringReader reader = new HostParser.StringReader(entry.getKey());
            assertEquals(HostParser.findURIType(reader), entry.getValue());
        }
    }