@Override
  public Optional<Serializer> getSerializer(
      TypeMirror typeMirror, SerializerFactory factory, ProcessingEnvironment processingEnv) {
    if (typeMirror.getKind() != TypeKind.DECLARED) {
      return Optional.empty();
    }

    DeclaredType declaredType = MoreTypes.asDeclared(typeMirror);
    TypeElement typeElement = MoreElements.asType(declaredType.asElement());
    if (typeElement.getQualifiedName().contentEquals("java.lang.String")) {
      return Optional.of(new TestStringSerializer(typeMirror));
    }

    return Optional.empty();
  }
A test implementation of {@link SerializerExtension} that overwrites a string field's value.
value/src/test/java/com/google/auto/value/extension/serializable/serializer/utils/TestStringSerializerFactory.java