public <U> Optional<U> getAndMapWorldState(
      final long blockNumber, final Function<MutableWorldState, ? extends Optional<U>> mapper) {
    final Hash blockHash =
        getBlockHeaderByNumber(blockNumber).map(BlockHeader::getHash).orElse(Hash.EMPTY);
    return getAndMapWorldState(blockHash, mapper);
  }
Wraps an operation on MutableWorldState with try-with-resources the corresponding block number

@param <U> return type of the operation on the MutableWorldState
@param blockNumber the block number
@param mapper Function which performs an operation on a MutableWorldState returning type U
@return the world state at the block number
ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/query/BlockchainQueries.java