Company company1 = new Company( "ObjectSpace" );
Company company2 = new Company( "Sun Microsystems" );
HashMap headquarters = new HashMap();
headquarters.put( company1, "Texas" );
headquarters.put( company2, "California" );
String location = (String) headquarters.get( company1 );
System.out.println( "The headquarters of " + company1 + " are in " + location );