public static LocalUri parse(String path) {
        if (path.startsWith(SCHEME)) {
            URI parsed = URI.create(path);
            path = parsed.getPath();
        }
        if (!path.startsWith(SLASH)) {
            throw new IllegalArgumentException("Path must start at root /");
        }
        StringTokenizer tok = new StringTokenizer(path, SLASH);
        LocalUri hpath = Root;
        while (tok.hasMoreTokens()) {
            hpath = hpath.append(tok.nextToken());
        }
        return hpath;
    }
@Test
    public void testParseMalformedRelative() {
        String path = "example////some-id//instances/some-instance-id";
        assertThrows(IllegalArgumentException.class, () -> LocalUri.parse(path));
    }