@Override
    public void shutdown() {
        scheduledExecutorService.shutdown();
        try {
            web3jService.close();
        } catch (IOException e) {
            throw new RuntimeException("Failed to close web3j service", e);
        }
    }
@Test
    public void testExceptionOnServiceClosure() throws Exception {

        assertThrows(
                RuntimeException.class,
                () -> {
                    doThrow(new IOException("Failed to close")).when(service).close();

                    web3j.shutdown();
                });
    }