@Test(expected = Wallet.ExceededMaxTransactionSize.class)
public void respectMaxStandardSize() throws Exception {

    // Check that we won't create txns > 100kb. Average tx size is ~220 bytes so this would have to be enormous.
    sendMoneyToWallet(AbstractBlockChain.NewBlockType.BEST_CHAIN, valueOf(100, 0));
    Transaction tx = new Transaction(UNITTEST);
    byte[] bits = new byte[20];
    new Random().nextBytes(bits);
    Coin v = CENT;
    // 3100 outputs to a random address.
    for (int i = 0; i < 3100; i++) {
        tx.addOutput(v, LegacyAddress.fromPubKeyHash(UNITTEST, bits));
    }
    SendRequest req = SendRequest.forTx(tx);
    wallet.completeTx(req);
}