@Test
public void testTransfer_allAccountsNeededToCoverAmount() throws IOException {

    setUpWireMockForCall("invokescript", "invokescript_transfer.json");
    setUpWireMockForGetBlockCount(1000);
    setUpWireMockForInvokeFunction("decimals", "invokefunction_decimals.json");
    setUpWireMockForBalanceOf(account1.getScriptHash(), "invokefunction_balanceOf_5.json");
    setUpWireMockForBalanceOf(account2.getScriptHash(), "invokefunction_balanceOf_4.json");
    setUpWireMockForBalanceOf(account3.getScriptHash(), "invokefunction_balanceOf_3.json");
    byte[] expectedScript = new ScriptBuilder()
            .contractCall(NEO_TOKEN_SCRIPT_HASH, NEP5_TRANSFER, Arrays.asList(
                    ContractParameter.hash160(account1.getScriptHash()),
                    ContractParameter.hash160(RECIPIENT_SCRIPT_HASH),
                    ContractParameter.integer(5)))
            .contractCall(NEO_TOKEN_SCRIPT_HASH, NEP5_TRANSFER, Arrays.asList(
                    ContractParameter.hash160(account2.getScriptHash()),
                    ContractParameter.hash160(RECIPIENT_SCRIPT_HASH),
                    ContractParameter.integer(4)))
            .contractCall(NEO_TOKEN_SCRIPT_HASH, NEP5_TRANSFER, Arrays.asList(
                    ContractParameter.hash160(account3.getScriptHash()),
                    ContractParameter.hash160(RECIPIENT_SCRIPT_HASH),
                    ContractParameter.integer(3)))
            .toArray();
    TransactionBuilder b = neoToken.transfer(Wallet.withAccounts(account1,
            account2, account3), RECIPIENT_SCRIPT_HASH, new BigDecimal("12"));
    assertThat(b.getScript(), is(expectedScript));
}