### Question:
CliqueExtraData implements ParsedExtraData { static CliqueExtraData decodeRaw(final BlockHeader header) { final Bytes input = header.getExtraData(); if (input.size() < EXTRA_VANITY_LENGTH + Signature.BYTES_REQUIRED) { throw new IllegalArgumentException( "Invalid Bytes supplied - too short to produce a valid Clique Extra Data object."); } final int validatorByteCount = input.size() - EXTRA_VANITY_LENGTH - Signature.BYTES_REQUIRED; if ((validatorByteCount % Address.SIZE) != 0) { throw new IllegalArgumentException("Bytes is of invalid size - i.e. contains unused bytes."); } final Bytes vanityData = input.slice(0, EXTRA_VANITY_LENGTH); final List<Address> validators = extractValidators(input.slice(EXTRA_VANITY_LENGTH, validatorByteCount)); final int proposerSealStartIndex = input.size() - Signature.BYTES_REQUIRED; final Signature proposerSeal = parseProposerSeal(input.slice(proposerSealStartIndex)); return new CliqueExtraData(vanityData, proposerSeal, validators, header); } CliqueExtraData(
      final Bytes vanityData,
      final Signature proposerSeal,
      final List<Address> validators,
      final BlockHeader header); static Bytes createWithoutProposerSeal(
      final Bytes vanityData, final List<Address> validators); static CliqueExtraData decode(final BlockHeader header); synchronized Address getProposerAddress(); Bytes encode(); static Bytes encodeUnsealed(final Bytes vanityData, final List<Address> validators); Bytes getVanityData(); Optional<Signature> getProposerSeal(); List<Address> getValidators(); static String createGenesisExtraDataString(final List<Address> validators); static final int EXTRA_VANITY_LENGTH; }### Answer:
@Test public void insufficientDataResultsInAnIllegalArgumentException() { final Bytes illegalData = Bytes.wrap(new byte[Signature.BYTES_REQUIRED + CliqueExtraData.EXTRA_VANITY_LENGTH - 1]); assertThatThrownBy(() -> CliqueExtraData.decodeRaw(createHeaderWithExtraData(illegalData))) .isInstanceOf(IllegalArgumentException.class) .hasMessage( "Invalid Bytes supplied - too short to produce a valid Clique Extra Data object."); }
@Test public void sufficientlyLargeButIllegallySizedInputThrowsException() { final Bytes illegalData = Bytes.wrap( new byte [Signature.BYTES_REQUIRED + CliqueExtraData.EXTRA_VANITY_LENGTH + Address.SIZE - 1]); assertThatThrownBy(() -> CliqueExtraData.decodeRaw(createHeaderWithExtraData(illegalData))) .isInstanceOf(IllegalArgumentException.class) .hasMessage("Bytes is of invalid size - i.e. contains unused bytes."); }