List<Animal> shelter = [Dog('Rex'), Animal('Generic')];
for (Animal a in shelter) {
  a.makeSound();
}
// Rex says: Woof!
// Generic makes a sound.
