private static long findLastBlockNumber(final List<? extends BlockStateCall> blockStateCalls) {
    var lastPresentBlockNumber =
        blockStateCalls.stream()
            .map(blockStateCall -> blockStateCall.getBlockOverrides().getBlockNumber())
            .filter(Optional::isPresent)
            .mapToLong(Optional::get)
            .max()
            .orElse(-1);
    long callsAfterLastPresentBlockNumber =
        blockStateCalls.stream()
            .filter(
                blockStateCall ->
                    blockStateCall.getBlockOverrides().getBlockNumber().orElse(Long.MAX_VALUE)
                        > lastPresentBlockNumber)
            .count();
    return lastPresentBlockNumber + callsAfterLastPresentBlockNumber;
  }
Normalizes a list of BlockStateCalls by filling gaps and setting the correct block number and
timestamp.

@param blockStateCalls the list of BlockStateCalls to normalize
@param header the initial block header
@return a normalized list of BlockStateCalls
ethereum/core/src/main/java/org/hyperledger/besu/ethereum/transaction/BlockStateCalls.java