A brief explanation of the Template Method design pattern from the Gang of Four, illustrated with Java's standard library. The pattern involves creating an abstract class with abstract methods that subclasses implement. Java's ArrayList, LinkedList, AbstractCollection, AbstractList, and AbstractMap all use this pattern — requiring only a few method implementations to create custom collections or maps.

2m watch time