    @Test
    public void markKeysAsUsed() throws Exception {

        control.replay();
        DeterministicKey key1 = wallet.currentReceiveKey();
        Transaction tx1 = FakeTxBuilder.createFakeTx(params, Coin.CENT, key1.toAddress(params));
        multiWallet.addPendingDownload(tx1.getHash());
        multiWallet.receive(tx1, 0);
        DeterministicKey key2 = wallet.currentReceiveKey();
        assertNotEquals(wallet.currentReceiveKey(), key1);
        Transaction tx2 = FakeTxBuilder.createFakeTx(params, Coin.CENT, key2.toAddress(params));
        multiWallet.addPendingDownload(tx2.getHash());
        multiWallet.receive(tx2, 0);
        assertNotEquals(wallet.currentReceiveKey(), key2);
        control.verify();
    }