void testTypeSpellings(TypeElement testClass) {
      ExecutableElement witness =
          ElementFilter.methodsIn(testClass.getEnclosedElements()).stream()
              .filter(m -> m.getSimpleName().contentEquals("witness"))
              .collect(onlyElement());
      if (witness.getReturnType().getAnnotationMirrors().isEmpty()) {
        System.err.println("SKIPPING TEST BECAUSE OF BUGGY COMPILER");
        return;
      }
      ImmutableMap<String, TypeMirror> typeSpellingToType = typesFromTestClass(testClass);
      assertThat(typeSpellingToType).isNotEmpty();
      StringBuilder text = new StringBuilder();
      StringBuilder expected = new StringBuilder();
      // Build up a fake source text with the encodings for the types in it, and decode it to
      // ensure the type spellings are what we expect.
      typeSpellingToType.forEach(
          (typeSpelling, type) -> {
            text.append("{").append(TypeEncoder.encodeWithAnnotations(type)).append("}");
            expected.append("{").append(typeSpelling).append("}");
          });
      String decoded = TypeEncoder.decode(text.toString(), processingEnv, "pkg", null);
      assertThat(decoded).isEqualTo(expected.toString());
    }
The types that we will compile and then recreate. They are referenced in a context where {@code
Set} is unambiguous but not {@code List}, which allows us to test the placement of annotations
in unqualified types like {@code Set<T>} and qualified types like {@code java.util.List<T>}.
value/src/test/java/com/google/auto/value/processor/SimplifyWithAnnotationsTest.java