public static <E> void writeCollection(
    @NotNull IonWriter writer,
    @NotNull String fieldName,
    @NotNull Collection<E> collection,
    @NotNull ThrowableConsumer<? super E, ? extends IOException> elementWriter
  ) throws IOException {
    writer.setFieldName(fieldName);
    writer.stepIn(IonType.LIST);
    for (E element : collection) {
      elementWriter.consume(element);
    }
    writer.stepOut();
  }
public static <E> void writeCollection(
    @NotNull IonWriter writer,
    @NotNull String fieldName,
    @NotNull Collection<E> collection,
    @NotNull ThrowableConsumer<? super E, ? extends IOException> elementWriter
  )