/**** * * This is a suitably upgraded version of BankAccountManagerTester, here to * work with the AssetManager class. * */ public class AssetManagerTester { public static void main(String args[]) { AssetManager am = new AssetManager(); /* * Add some accounts. */ BankAccount wells = new BankAccount("Wells Fargo", 1110.25); BankAccount cayman = new BankAccount("Cayman Islands", 10560185.00); Car honda = new Car("Honda", "Civic"); Car rolls = new Car("Rolls Royce", "Ghost"); am.add(wells); am.add(cayman); am.add(honda); am.add(rolls); /* * Print the total value of all assests. */ System.out.println("Net worth = $" + am.getTotalValue()); /* * Print a list of all assests. */ System.out.println("\nList of all assets:\n" + am); /* * Print a sorted list. BUT WAIT, the output doesn't get sorted!. * See the comment for the method AssetMangerTester.sort */ am.sort(); System.out.println("List of all assets, sorted by value:\n" + am); System.out.print( "Hmm, that list doesn't look sorted. See comments in the code "); System.out.println("to find out why."); } }