public void addCoinsReceivedEventListener(WalletCoinsReceivedEventListener listener) {
        addCoinsReceivedEventListener(Threading.USER_THREAD, listener);
    }
@Test
    public void exceptionsDoNotBlockAllListeners() {
        // Check that if a wallet listener throws an exception, the others still run.
        wallet.addCoinsReceivedEventListener((wallet, tx, prevBalance, newBalance) -> {
            log.info("onCoinsReceived 1");
            throw new RuntimeException("barf");
        });
        final AtomicInteger flag = new AtomicInteger();
        wallet.addCoinsReceivedEventListener((wallet, tx, prevBalance, newBalance) -> {
            log.info("onCoinsReceived 2");
            flag.incrementAndGet();
        });

        sendMoneyToWallet(AbstractBlockChain.NewBlockType.BEST_CHAIN, COIN);
        log.info("Wait for user thread");
        Threading.waitForUserCode();
        log.info("... and test flag.");
        assertEquals(1, flag.get());
    }