Unused polymorphism example
class MyInteger { int value; … }
class Link { Object element; Link next; … }
class List { Link header; … }
List myList = new List();
for (int i=0; i<10; i++)
  myList.add(new MyInteger(i));
Desired invariant in class List
header.closure(next).element.value: sorted by £
[Slowly and clearly explain the example.]

Also works for subtype polymorphism!

Polymorphism available in the source code but not used during execution.

This is actual code, not a contrived example (actually it’s simplified).
(MyInteger is used instead of Integer because Java 1.1’s Integer doesn’t support the Comparable interface, but myInteger does (though I haven’t shown that on the slide).)