private TypeSpec generate() {
      TypeSpec.Builder proxy =
          TypeSpec.classBuilder(PROXY_CLASS_NAME)
              .addModifiers(Modifier.STATIC)
              .addTypeVariables(typeVariableNames)
              .addSuperinterface(Serializable.class)
              .addField(serialVersionUid())
              .addFields(properties())
              .addMethod(constructor())
              .addMethod(readResolve());

      return proxy.build();
    }
A generator of nested serializable Proxy classes.
value/src/main/java/com/google/auto/value/extension/serializable/processor/SerializableAutoValueExtension.java