public int groupCount() {
            return scheme.groupCount() + host.groupCount() + (port > 0 ? 1 : 0) + path.groupCount();
        }
<p>Returns the number of captured groups of this match. Any non-negative integer smaller than the value
returned by this method is a valid group index for this match.</p>

@return The number of captured groups.
jdisc_core/src/main/java/com/yahoo/jdisc/application/UriPattern.java