code: public static void decodePathSegment(List<PathSegment> segments, String segment, boolean decode) {
          int colon = segment.indexOf(';');
          if (colon != -1) {
              segments.add(new PathSegmentImpl(
                      (colon == 0) ? "" : segment.substring(0, colon),
                      decode,
                      decodeMatrix(segment, decode)));
          } else {
              segments.add(new PathSegmentImpl(
                      segment,
                      decode));
          }
      }
docs: Decode the path segment and add it to the list of path segments.
  
  @param segments mutable list of path segments.
  @param segment  path segment to be decoded.
  @param decode   {@code true} if the path segment should be in a decoded form.