@Override
    public String generateClass(
        Context context, String className, String classToExtend, boolean isFinal) {
      StringBuilder constructor =
          new StringBuilder().append("  public ").append(className).append("(");

      boolean first = true;
      for (Map.Entry<String, ExecutableElement> el : context.properties().entrySet()) {
        if (first) {
          first = false;
        } else {
          constructor.append(", ");
        }
        constructor.append("String ").append(el.getKey());
      }

      constructor.append(") {\n");
      constructor.append("    super(");

      first = true;
      for (Map.Entry<String, ExecutableElement> el : context.properties().entrySet()) {
        if (first) {
          first = false;
        } else {
          constructor.append(", ");
        }
        constructor.append(el.getKey());
      }
      constructor.append(");\n");
      constructor.append("  }\n");

      return String.format(
          "package %s;\n"
              + "\n"
              + "%s class %s extends %s {\n"
              + constructor
              + "  @Override public String foo() {\n"
              + "    return \"foo\";\n"
              + "  }\n"
              + "  public String dizzle() {\n"
              + "    return \"dizzle\";\n"
              + "  }\n"
              + "}",
          context.packageName(),
          isFinal ? "final" : "abstract",
          className,
          classToExtend);
    }
Tests that extensions providing their own implemented annotation types or options get picked
up.
value/src/test/java/com/google/auto/value/processor/ExtensionTest.java