public synchronized void transfer(int accountA, int accountB, int amount) {
    if (accounts[accountA] >= amount && accountA != accountB) {
      accounts[accountB] += amount;
      accounts[accountA] -= amount;
      if (LOGGER.isDebugEnabled()) {
        LOGGER.debug(
            "Transferred from account: {} to account: {} , amount: {} , bank balance at: {}, source account balance: {}, destination account balance: {}",
            accountA,
            accountB,
            amount,
            getBalance(),
            getBalance(accountA),
            getBalance(accountB));
      }
    }
  }
@Test
  void TransferMethodHaveToTransferAmountFromAnAccountToOtherAccount() {
    bank.transfer(0, 1, 1000);
    int[] accounts = bank.getAccounts();
    assertEquals(0, accounts[0]);
    assertEquals(2000, accounts[1]);
  }