public Path head(int count) {
            requireInRange(count, "head count", 0, length);
            Node node = head;
            for (int i = count; i < length; i++)
                node = node.next;

            return new Path(node, count, true, validator);
        }
Returns a copy of this where only the first segments are retained, and with a trailing slash.
vespajlib/src/main/java/ai/vespa/http/HttpURL.java