private static TypeName annotatedType(TypeMirror type) {
    List<AnnotationSpec> annotations =
        type.getAnnotationMirrors().stream().map(AnnotationSpec::get).collect(toList());

    return TypeName.get(type).annotated(annotations);
  }
Translate a {@link TypeMirror} into a {@link TypeName}, including type annotations.
value/src/main/java/com/google/auto/value/extension/toprettystring/processor/ExtensionClassTypeSpecBuilder.java