Java · Inheritance, polymorphism and interfaces
The library can sort any list once each object can say whether it comes before another.