docs: public static void typeToString(final TypeMirror type, final StringBuilder result,
        final char innerClassSeparator) {
      type.accept(new SimpleTypeVisitor6<Void, Void>() {
        @Override public Void visitDeclared(DeclaredType declaredType, Void v) {
          TypeElement typeElement = (TypeElement) declaredType.asElement();
          rawTypeToString(result, typeElement, innerClassSeparator);
          List<? extends TypeMirror> typeArguments = declaredType.getTypeArguments();
          if (!typeArguments.isEmpty()) {
            result.append("<");
            for (int i = 0; i < typeArguments.size(); i++) {
              if (i != 0) {
                result.append(", ");
              }
              typeToString(typeArguments.get(i), result, innerClassSeparator);
            }
            result.append(">");
          }
          return null;
        }
        @Override public Void visitPrimitive(PrimitiveType primitiveType, Void v) {
          result.append(box((PrimitiveType) type));
          return null;
        }
        @Override public Void visitArray(ArrayType arrayType, Void v) {
          TypeMirror type = arrayType.getComponentType();
          if (type instanceof PrimitiveType) {
            result.append(type.toString()); // Don't box, since this is an array.
          } else {
            typeToString(arrayType.getComponentType(), result, innerClassSeparator);
          }
          result.append("[]");
          return null;
        }
        @Override public Void visitTypeVariable(TypeVariable typeVariable, Void v) {
          result.append(typeVariable.asElement().getSimpleName());
          return null;
        }
        @Override public Void visitError(ErrorType errorType, Void v) {
          // Error type found, a type may not yet have been generated, but we need the type
          // so we can generate the correct code in anticipation of the type being available
          // to the compiler.
  
          // Paramterized types which don't exist are returned as an error type whose name is "<any>"
          if ("<any>".equals(errorType.toString())) {
            throw new CodeGenerationIncompleteException(
                "Type reported as <any> is likely a not-yet generated parameterized type.");
          }
          // TODO(cgruber): Figure out a strategy for non-FQCN cases.
          result.append(errorType.toString());
          return null;
        }
        @Override protected Void defaultAction(TypeMirror typeMirror, Void v) {
          throw new UnsupportedOperationException(
              "Unexpected TypeKind " + typeMirror.getKind() + " for "  + typeMirror);
        }
      }, null);
    }