private ImmutableMap<String, Object> toVars() {
    Map<String, Object> vars = new TreeMap<>();
    for (Field field : fields) {
      Object value = fieldValue(field, this);
      if (value == null) {
        throw new IllegalArgumentException("Field cannot be null (was it set?): " + field);
      }
      Object old = vars.put(field.getName(), value);
      if (old != null) {
        throw new IllegalArgumentException("Two fields called " + field.getName() + "?!");
      }
    }
    return ImmutableMap.copyOf(vars);
  }
Returns the result of substituting the variables defined by the fields of this class (a
concrete subclass of TemplateVars) into the template returned by {@link #parsedTemplate()}.
value/src/main/java/com/google/auto/value/processor/TemplateVars.java