```
var dog = Animal(true, 5)
var cat = Animal(true, 4)
var turtle = Animal(false, 3)
val animalList = listOf<Animal>(dog, cat, turtle)

```

I want to iterate my animalList and see if the animal is a Mammal

Here is my Animal class below

```
class Animal(isMammal: Boolean, numberOfAnimal: Int) {
    private var _isMammal:Boolean = false
    private var _count: Int = 0
    init {
        _isMammal = isMammal
        _count = numberOfAnimal
    }
    fun getType(): String {
        if(_isMammal) {
            return "Mammal"
        }
        else {
            return "Not A Mammal"
        }
    }
    fun updateCount(modifyAnimalCountBy:Int)
    {
        _count = _count + modifyAnimalCountBy
    }
    fun getCount(): Int {
        return _count
    }
}

```