public Account[] getRandomPair() {
        Account[] fromToAccounts = new Account[2];
        int[] index = new int[2];

        while ((fromToAccounts[0] == null) || (fromToAccounts[1] == null)) {
            try {
                index[0] = (int) (Math.random() * MAX_INIT_AMOUNT);
                index[1] = (int) (Math.random() * MAX_INIT_AMOUNT);

                if (index[0] != index[1]) {
                    fromToAccounts[0] = bank.getAccount(index[0]);
                    fromToAccounts[1] = bank.getAccount(index[1]);
                }

            } catch (IllegalArgumentException e) {
                fromToAccounts[0] = null;
                fromToAccounts[1] = null;
            }
        }

        return fromToAccounts;
    }