code: public static ResourceName create(PathTemplate template, Map<String, String> values) {
      if (!values.keySet().containsAll(template.vars())) {
        Set<String> unbound = Sets.newLinkedHashSet(template.vars());
        unbound.removeAll(values.keySet());
        throw new ValidationException("unbound variables: %s", unbound);
      }
      return new ResourceName(template, values, null);
    }
docs: Creates a new resource name from a template and a value assignment for variables.
  
  @throws ValidationException if not all variables in the template are bound.