Example of why to downcast with interfaces

Using the following link as a starting point, help me answer a question.


In the example they have a class

public class AnimalTrainer {
public void teach(Animal anim) {
    // do animal-things

    // if there's a dog, tell it barks
    if (anim instanceof Dog) {
        Dog dog = (Dog) anim;

Then they present two ways of making an object like

Cat cat = new Cat()
Animal cat = new Cat()
Mammal mamm = new Cat()

I tested it in my editor and they all work the same. Why might someone want to do the 2nd or 3rd option. Can someone explain why or perhaps give an example scenario?

Mammal mamm = new Cat()

In this case Mammal is an interface that is implemented by Cat. But I don't see any polymorphism tricks because everything works the same if I use cat -- I'm having trouble imagining the scenarios.