@Test
  void shouldThrowExceptionWhenExceedingMaxBlocks() {
    long maxAllowedBlockNumber = MAX_BLOCK_CALL_SIZE + 1;
    long invalidBlockNumber = maxAllowedBlockNumber + 1;
    BlockStateCall blockStateCall = createBlockStateCall(invalidBlockNumber, null);
    IllegalArgumentException exception =
        assertThrows(
            IllegalArgumentException.class,
            () -> BlockStateCalls.fillBlockStateCalls(List.of(blockStateCall), mockBlockHeader));
    String expectedMessage =
        String.format(
            "Block number %d exceeds the limit of %d (header: %d + MAX_BLOCK_CALL_SIZE: %d)",
            invalidBlockNumber, maxAllowedBlockNumber, 1L, MAX_BLOCK_CALL_SIZE);
    assertEquals(expectedMessage, exception.getMessage());
  }
Tests that an exception is thrown when the maximum number of BlockStateCalls is exceeded.
ethereum/core/src/test/java/org/hyperledger/besu/ethereum/transaction/BlockStateCallsTest.java