private StringBuilder typeAnnotationsToBuffer(List<? extends AnnotationMirror> annotations, boolean nestedTypeUse) {
    StringBuilder annotationBuffer = new StringBuilder(100);
    for (AnnotationMirror annotationMirror : annotations) {
      boolean canBeAppliedToMethodAsWell = !nestedTypeUse // just to short circuit computation early
          && Annotations.annotationMatchesTarget(annotationMirror.getAnnotationType().asElement(), ElementType.METHOD);
      if (canBeAppliedToMethodAsWell) {
        // skip this type annotation on top type
        continue;
      }
      CharSequence sequence = AnnotationMirrors.toCharSequence(annotationMirror, importsResolver);
      if (!nullableTypeAnnotation && sequence.toString().endsWith(nullableAnnotationName)) {
        this.nullableTypeAnnotation = true;
      }
      annotationBuffer
          .append(sequence)
          .append(' ');
    }
    return annotationBuffer;
  }
Encapsulates routines and various hacks for get relevant strings for the raw types and type
parameters, while attempting to resolve unresolved types using source imports.
value-processor/src/org/immutables/value/processor/meta/TypeStringProvider.java