@Override
            public String visitDeclared(DeclaredType type, Void v) {
              String simpleName = simpleNameForType(type);
              if (type.getTypeArguments().isEmpty()) {
                return simpleName;
              }
              ImmutableList<String> typeArgumentNames =
                  type.getTypeArguments().stream()
                      .map(t -> simpleNameForType(t))
                      .collect(toImmutableList());
              if (isMapOrMultimap(type) && typeArgumentNames.size() == 2) {
                return String.format(
                    "%sOf%sTo%s", simpleName, typeArgumentNames.get(0), typeArgumentNames.get(1));
              }

              List<String> parts = new ArrayList<>();
              parts.add(simpleName);
              parts.add("Of");
              parts.addAll(typeArgumentNames.subList(0, typeArgumentNames.size() - 1));
              if (typeArgumentNames.size() > 1) {
                parts.add("And");
              }
              parts.add(getLast(typeArgumentNames));
              return String.join("", parts);
            }
Returns a valid Java identifier for method or variable of type {@code type}.
value/src/main/java/com/google/auto/value/extension/toprettystring/processor/ToPrettyStringExtension.java