Ejemplo n.º 1
0
 static {
   petPeople.put(new Person("Dawn"), Arrays.asList(new Cymric("Molly"), new Mutt("Spot")));
   petPeople.put(
       new Person("Kate"),
       Arrays.asList(new Cat("Shackleton"), new Cat("Elsie May"), new Dog("Margrett")));
   petPeople.put(
       new Person("Marilyn"),
       Arrays.asList(
           new Pug("Louie aka Louis Snorkelstein Dupree"),
           new Cat("Stanford aka Stinky el Negro"),
           new Cat("Pinkola")));
   petPeople.put(new Person("Luke"), Arrays.asList(new Rat("Fuzzy"), new Rat("Fizzy")));
   petPeople.put(new Person("Isaac"), Arrays.asList(new Rat("Freckly")));
 }
 public static void main(String[] args) {
   CollectionSequence2 c = new CollectionSequence2();
   CollectionSequence2.display(c);
   CollectionSequence2.display(c.iterator());
   System.out.println(Arrays.toString(c.toArray(new Pet[0])));
 }