### Question:
IbftLegacyBlockInterface implements BlockInterface { @Override public Optional<ValidatorVote> extractVoteFromHeader(final BlockHeader header) { final Address candidate = header.getCoinbase(); if (!candidate.equals(NO_VOTE_SUBJECT)) { final Address proposer = getProposerOfBlock(header); final VoteType votePolarity = voteToValue.inverse().get(header.getNonce()); final Address recipient = header.getCoinbase(); return Optional.of(new ValidatorVote(votePolarity, proposer, recipient)); } return Optional.empty(); }  @Override Address getProposerOfBlock(final BlockHeader header); @Override Address getProposerOfBlock(final org.hyperledger.besu.plugin.data.BlockHeader header); @Override Optional<ValidatorVote> extractVoteFromHeader(final BlockHeader header); static BlockHeaderBuilder insertVoteToHeaderBuilder(
      final BlockHeaderBuilder builder, final Optional<ValidatorVote> vote); @Override Collection<Address> validatorsInBlock(final BlockHeader header); static boolean isValidVoteValue(final long value); static final Address NO_VOTE_SUBJECT; static final long ADD_NONCE; static final long DROP_NONCE; }### Answer:
@Test public void headerWithZeroCoinbaseReturnsAnEmptyVote() { assertThat(blockInterface.extractVoteFromHeader(headerBuilder.buildHeader())).isEmpty(); }
@Test public void headerWithNonceOfZeroReportsDropVote() { headerBuilder.nonce(0x0L).coinbase(AddressHelpers.ofValue(2)); final BlockHeader header = TestHelpers.createIbftSignedBlockHeader(headerBuilder, proposerKeys, validatorList); final Optional<ValidatorVote> extractedVote = blockInterface.extractVoteFromHeader(header); assertThat(extractedVote) .contains(new ValidatorVote(DROP, proposerAddress, header.getCoinbase())); }
@Test public void headerWithNonceOfMaxLongReportsAddVote() { headerBuilder.nonce(0xFFFFFFFFFFFFFFFFL).coinbase(AddressHelpers.ofValue(2)); final BlockHeader header = TestHelpers.createIbftSignedBlockHeader(headerBuilder, proposerKeys, validatorList); final Optional<ValidatorVote> extractedVote = blockInterface.extractVoteFromHeader(header); assertThat(extractedVote) .contains(new ValidatorVote(ADD, proposerAddress, header.getCoinbase())); }