private void assertBlockResultMatchesBlock(final JsonObject result, final Block block) {
    final BlockHeader header = block.getHeader();
    assertThat(Hash.fromHexString(result.getString("parentHash")))
        .isEqualTo(header.getParentHash());
    assertThat(Hash.fromHexString(result.getString("sha3Uncles")))
        .isEqualTo(header.getOmmersHash());
    assertThat(Hash.fromHexString(result.getString("transactionsRoot")))
        .isEqualTo(header.getTransactionsRoot());
    assertThat(Hash.fromHexString(result.getString("stateRoot"))).isEqualTo(header.getStateRoot());
    assertThat(Hash.fromHexString(result.getString("receiptsRoot")))
        .isEqualTo(header.getReceiptsRoot());
    assertThat(Address.fromHexString(result.getString("miner"))).isEqualTo(header.getCoinbase());
    assertThat(Difficulty.fromHexString(result.getString("difficulty")))
        .isEqualTo(header.getDifficulty());
    assertThat(Bytes.fromHexStringLenient(result.getString("extraData")))
        .isEqualTo(header.getExtraData());
    assertThat(hexStringToInt(result.getString("size"))).isEqualTo(block.getSize());
    assertThat(Long.decode(result.getString("gasLimit"))).isEqualTo(header.getGasLimit());
    assertThat(Long.decode(result.getString("gasUsed"))).isEqualTo(header.getGasUsed());
    assertThat(Long.decode(result.getString("timestamp"))).isEqualTo(header.getTimestamp());
    assertThat(Long.decode(result.getString("number"))).isEqualTo(header.getNumber());
    // Nonce is a data field and should represent 8 bytes exactly
    final String nonceResult = result.getString("nonce").toLowerCase(Locale.ROOT);
    assertThat(nonceResult.length() == 18 && nonceResult.startsWith("0x")).isTrue();
    assertThat(Long.parseUnsignedLong(nonceResult.substring(2), 16)).isEqualTo(header.getNonce());
    assertThat(Hash.fromHexString(result.getString("hash"))).isEqualTo(header.getHash());
    assertThat(Bytes.fromHexString(result.getString("logsBloom"))).isEqualTo(header.getLogsBloom());
  }
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