@Test
public void balances() throws Exception {

    Coin nanos = COIN;
    Transaction tx1 = sendMoneyToWallet(AbstractBlockChain.NewBlockType.BEST_CHAIN, nanos);
    assertEquals(nanos, tx1.getValueSentToMe(wallet));
    assertTrue(tx1.getWalletOutputs(wallet).size() >= 1);
    // Send 0.10 to somebody else.
    Transaction send1 = wallet.createSend(OTHER_ADDRESS, valueOf(0, 10));
    // Reserialize.
    Transaction send2 = PARAMS.getDefaultSerializer().makeTransaction(send1.bitcoinSerialize());
    assertEquals(nanos, send2.getValueSentFromMe(wallet));
    assertEquals(ZERO.subtract(valueOf(0, 10)), send2.getValue(wallet));
}