default <T> void writeList(final Iterable<T> values, final BiConsumer<T, RLPOutput> valueWriter) {
    startList();
    for (final T v : values) {
      valueWriter.accept(v, this);
    }
    endList();
  }
Writes a list of values of a specific class provided a function to write values of that class
to an {@link RLPOutput}.

<p>This is a convenience method whose result is equivalent to doing:

<pre>{@code
startList();
for (T v : values) {
  valueWriter.accept(v, this);
}
endList();
}</pre>

@param values A list of value of type {@code T}.
@param valueWriter A method that given a value of type {@code T} and an {@link RLPOutput},
    writes this value to the output.
@param <T> The type of values to write.
ethereum/rlp/src/main/java/org/hyperledger/besu/ethereum/rlp/RLPOutput.java