I think of this as broken OOP. It's starting to grow like mold in our code base and I need to start talking with people about cleaning it up. Is there a common name for it?
public void eat(Fruit fruit) {
if (fruit instanceof Banana) {
((Banana) fruit).peel();
}
else if (fruit instanceof Pineapple) {
((Pineapple) fruit).slice();
}
// ... etc ...
else if (fruit instanceof Strawberry) {
// n/a ;-)
}
fruit.eat();
}