@Test
public void cleanup() throws Exception {

    Transaction t = cleanupCommon(OTHER_ADDRESS);
    // Consider the new pending as risky and remove it from the wallet
    wallet.setRiskAnalyzer(new TestRiskAnalysis.Analyzer(t));
    wallet.cleanup();
    assertTrue(wallet.isConsistent());
    assertEquals("Wrong number of PENDING", 1, wallet.getPoolSize(WalletTransaction.Pool.PENDING));
    assertEquals("Wrong number of UNSPENT", 0, wallet.getPoolSize(WalletTransaction.Pool.UNSPENT));
    assertEquals("Wrong number of ALL", 2, wallet.getTransactions(true).size());
    assertEquals(valueOf(0, 50), wallet.getBalance(Wallet.BalanceType.ESTIMATED));
}