private static Object decode(final RLPInput in) {
    if (!in.nextIsList()) {
      return in.readBytes();
    }

    final int size = in.enterList();
    final List<Object> l = new ArrayList<>(size);
    for (int i = 0; i < size; i++) l.add(decode(in));
    in.leaveList();
    return l;
  }
Recursively decodes an RLP encoded value. Byte strings are assumed to be non-scalar (leading
zeros are allowed).

@param value The RLP encoded value to decode.
@return The output of decoding {@code value}. It will be either directly a {@link Bytes}, or a
    list whose elements are either {@link Bytes}, or similarly composed sub-lists.
@throws RLPException if {@code value} is not a properly formed RLP encoding.
ethereum/rlp/src/test-support/java/org/hyperledger/besu/ethereum/rlp/util/RLPTestUtil.java