Coordinating and Traversing
Observer and Mediator, Chain of Responsibility and Iterator with streams, and Visitor, Memento, and Interpreter.
Observer and Mediator
Two coordination patterns for a many-party system, taught against a shipment tracker and a warehouse dispatch desk: Observer fans a status change out to independently subscribed listeners behind one functional interface, and Mediator centralizes a many-to-many conversation behind a single hub so a warehouse, a carrier, and a notification service never reference each other directly.
Chain of Responsibility and Iterator
Two patterns for coordinating a collection of objects rather than one: Chain of Responsibility routes a request through a sequence of handlers until one of them acts, built as an object chain and as a Stream-driven functional composition, and Iterator provides sequential access to an aggregate without exposing its internal structure, built by hand against a zone-bucketed shipment manifest and then exposed as a Stream with no extra code, through Iterable's default spliterator() method.
Visitor, Memento, and Interpreter
Three idiomatic Java patterns for a fixed shipping-manifest hierarchy: Visitor expressed as a sealed interface and an exhaustive pattern-matching switch that adds operations with no accept() method anywhere, Memento as a package-private snapshot record that lets a draft manifest roll back to an earlier state in one call, and Interpreter as a small sealed surcharge-expression grammar whose nesting decides the evaluated result.