Skip to content

Glossary: Software Design Patterns in Java

Clock (injected clock)

Also written: injected clock, Supplier<Instant>

A `Supplier<Instant>` passed into code that needs the time. A test passes a fixed time and `main` passes the real `Instant::now`.

Where the book teaches it

Related terms

SupplierInstantDependency injection