@Test
  public void ethGetStorageAtEarliest() throws Exception {
    // Setup mocks to return a block
    final BlockDataGenerator gen = new BlockDataGenerator();
    final Address address = gen.address();
    final String mockStorage = "0x0000000000000000000000000000000000000000000000000000000000000006";
    final Hash blockHash =
        Hash.fromHexString("0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470");
    when(blockchainQueries.storageAt(address, UInt256.ONE, blockHash))
        .thenReturn(Optional.of(UInt256.fromHexString(mockStorage)));

    final String id = "88";
    final RequestBody body =
        RequestBody.create(
            "{\"jsonrpc\":\"2.0\",\"id\":"
                + Json.encode(id)
                + ",\"method\":\"eth_getStorageAt\", \"params\": [\""
                + address
                + "\",\""
                + UInt256.ONE
                + "\",\"earliest\"]}",
            JSON);

    try (final Response resp = client.newCall(buildPostRequest(body)).execute()) {
      assertThat(resp.code()).isEqualTo(200);
      // Check general format of result
      final String respBody = resp.body().string();
      final JsonObject json = new JsonObject(respBody);
      testHelper.assertValidJsonRpcResult(json, id);
      // Check result
      final String result = json.getString("result");
      assertThat(result)
          .isEqualTo("0x0000000000000000000000000000000000000000000000000000000000000006");
    }
  }
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