code: public ImmutableMap<String, String> validatedMatch(String path, String exceptionMessagePrefix) {
      ImmutableMap<String, String> matchMap = match(path);
      if (matchMap == null) {
        throw new ValidationException(
            String.format(
                "%s: Parameter \"%s\" must be in the form \"%s\"",
                exceptionMessagePrefix, path, this.toString()));
      }
      return matchMap;
    }
docs: Matches the path, returning a map from variable names to matched values. All matched values
  will be properly unescaped using URL encoding rules. If the path does not match the template,
  throws a ValidationException. The exceptionMessagePrefix parameter will be prepended to the
  ValidationException message.
  
  <p>If the path starts with '//', the first segment will be interpreted as a host name and
  stored in the variable {@link #HOSTNAME_VAR}.
  
  <p>See the {@link PathTemplate} class documentation for examples.
  
  <p>For free wildcards in the template, the matching process creates variables named '$n', where
  'n' is the wildcard's position in the template (starting at n=0). For example: <pre>
  PathTemplate template = PathTemplate.create("shelves/*&#47;books/*");
  assert template.validatedMatch("shelves/s1/books/b2", "User exception string")
  .equals(ImmutableMap.of("$0", "s1", "$1", "b1"));
  assert template.validatedMatch("//somewhere.io/shelves/s1/books/b2", "User exception string")
  .equals(ImmutableMap.of(HOSTNAME_VAR, "//somewhere.io", "$0", "s1", "$1", "b1"));
  </pre>
  
  All matched values will be properly unescaped using URL encoding rules (so long as URL encoding
  has not been disabled by the {@link #createWithoutUrlEncoding} method).