public static <T> int writeList(WriteBuffer.Writer<T> writer, List<T> value, byte[] out,
    int pos) {
    if (value.isEmpty()) {
      out[pos++] = '[';
      out[pos++] = ']';
      return 2;
    }
    int initialPos = pos;
    WriteBuffer result = WriteBuffer.wrap(out, pos);
    writeList(writer, value, result);
    return result.pos() - initialPos;
  }
Inability to encode is a programming bug.
zipkin/src/main/java/zipkin2/internal/JsonCodec.java