@Test
public void testTransferFunds() throws IOException, ClassNotFoundException {

    AccountAddress senderAddress = AccountAddress.fromHexString("Sender");
    AccountState senderAccountState = AppServiceProvider.getAccountStateService().getOrCreateAccountState(senderAddress, accounts);
    AccountAddress receiverAddress = AccountAddress.fromHexString("Receiver");
    senderAccountState.setBalance(BigInteger.TEN);
    AppServiceProvider.getAccountStateService().setAccountState(senderAddress, senderAccountState, accounts);
    accountsManager.transferFunds(accounts, "Sender", "Receiver", BigInteger.ONE, BigInteger.ZERO, operation);
    senderAccountState = AppServiceProvider.getAccountStateService().getOrCreateAccountState(senderAddress, accounts);
    Assert.assertTrue(senderAccountState.getBalance().longValue() == 9);
    AccountState receiverAccountState = AppServiceProvider.getAccountStateService().getOrCreateAccountState(receiverAddress, accounts);
    Assert.assertTrue(receiverAccountState.getBalance().longValue() == 1);
    Assert.assertTrue(senderAccountState.getNonce().longValue() == 1);
}