/**** * * This version of the tester adds a call to BankAccountManager.sort, made * possible by BankAccount's implementation of the Comparable interface. * */ public class BankAccountManagerTester { public static void main(String[] args) { BankAccountManager bam = new BankAccountManager(); /* * Add some accounts. */ bam.add(new BankAccount("Wells Fargo", 1110.25)); bam.add(new BankAccount("Credit Union", 550.10)); bam.add(new BankAccount("Cayman Islands", 10560185.00)); /* * Print the total value of all accounts. */ System.out.println("Total value of all accounts = $" + bam.getTotalValue()); /* * Print a list of all the accounts. */ System.out.println("\nList of all accounts:\n" + bam); /* * Print a sorted list. */ bam.sort(); System.out.println("List of all accounts, sorted by balance:\n" + bam); } }