public BlockWithMetadata<TransactionWithMetadata, Hash> blockWithMetadata(final Block block) {
    final Difficulty td = block.getHeader().getDifficulty().add(10L);
    final int size = block.getSize();

    final List<Transaction> txs = block.getBody().getTransactions();
    final List<TransactionWithMetadata> formattedTxs = new ArrayList<>(txs.size());
    for (int i = 0; i < txs.size(); i++) {
      formattedTxs.add(
          new TransactionWithMetadata(
              txs.get(i),
              block.getHeader().getNumber(),
              block.getHeader().getBaseFee(),
              block.getHash(),
              i));
    }
    final List<Hash> ommers =
        block.getBody().getOmmers().stream().map(BlockHeader::getHash).collect(Collectors.toList());
    return new BlockWithMetadata<>(block.getHeader(), formattedTxs, ommers, td, size);
  }
Tests that empty batch requests are treated as invalid requests as per
http://www.jsonrpc.org/specification#batch.
ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTest.java