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

    // Extract the T of ImmutableList<T>.
    TypeMirror containedType = getContainedType(typeMirror);
    Serializer containedTypeSerializer = factory.getSerializer(containedType);

    // We don't need this serializer if the T of ImmutableList<T> is serializable.
    if (containedTypeSerializer.isIdentity()) {
      return Optional.empty();
    }

    return Optional.of(
        new ImmutableListSerializer(containedTypeSerializer, factory, processingEnv));
  }
A {@link SerializerExtension} that deserializes objects inside an {@link ImmutableList}.

<p>Enables unserializable objects inside an ImmutableList to be serializable.
value/src/main/java/com/google/auto/value/extension/serializable/serializer/impl/ImmutableListSerializerExtension.java