@Test
  public void incorrectlyStructuredRlpThrowsException() {
    final List<Address> validators = Lists.newArrayList();
    final int round = 0x00FEDCBA;
    final List<SECPSignature> committerSeals = Lists.newArrayList();

    // Create a byte buffer with no data.
    final byte[] vanity_bytes = new byte[32];
    final Bytes vanity_data = Bytes.wrap(vanity_bytes);

    final BytesValueRLPOutput encoder = new BytesValueRLPOutput();
    encoder.startList();
    encoder.writeBytes(vanity_data);
    encoder.writeList(validators, (validator, rlp) -> rlp.writeBytes(validator));

    // encoded vote
    encoder.startList();
    encoder.writeBytes(Address.fromHexString("1"));
    encoder.writeByte(Vote.ADD_BYTE_VALUE);
    encoder.endList();

    encoder.writeInt(round);
    encoder.writeList(committerSeals, (committer, rlp) -> rlp.writeBytes(committer.encodedBytes()));
    encoder.writeLong(1);
    encoder.endList();

    final Bytes bufferToInject = encoder.encoded();

    assertThatThrownBy(() -> bftExtraDataCodec.decodeRaw(bufferToInject))
        .isInstanceOf(RLPException.class);
  }
This test specifically verifies that {@link QbftExtraDataCodec#decode(BlockHeader)} uses {@link
RLPInput#readIntScalar()} rather than {@link RLPInput#readInt()} to decode the round number
consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/QbftExtraDataCodecTest.java