private MethodSpec constructor() {
    MethodSpec.Builder constructor = constructorBuilder();
    // TODO(b/35944623): Replace this with a standard way of avoiding keywords.
    Set<String> propertyNames = context.properties().keySet();
    ImmutableMap<String, String> parameterNames =
        propertyNames.stream()
            .collect(toImmutableMap(name -> name, name -> generateIdentifier(name, propertyNames)));
    context
        .propertyTypes()
        .forEach(
            (name, type) ->
                constructor.addParameter(annotatedType(type), parameterNames.get(name)));
    String superParams =
        context.properties().keySet().stream().map(parameterNames::get).collect(joining(", "));
    constructor.addStatement("super($L)", superParams);
    return constructor.build();
  }
A factory for {@link TypeSpec}s used in {@link AutoValueExtension} implementations.

<p>This is copied from {@link
com.google.auto.value.extension.memoized.processor.MemoizeExtension} until we find a better
location to consolidate the code.
value/src/main/java/com/google/auto/value/extension/toprettystring/processor/ExtensionClassTypeSpecBuilder.java