// Find new transfers
List<Transfer> newTransfers = new ArrayList<Transfer>();
for (Transaction transaction : transactions) {
if (transferHistory.get(transaction.getId()) == null) {
if (transaction.getClass().equals(CashTransfer.class)) {
CashTransfer cashTransfer = (CashTransfer)transaction;
Transfer transfer = new Transfer(
cashTransfer.getId(),
cashTransfer.getAccount().getName(),
cashTransfer.getAmount());
transferHistory.put(transfer.id, transfer);
newTransfers.add(transfer);
}
}
}