The fictional Elm Street Library desk manager needs dependable lending rules. Input commands describe deliveries, loans, returns, and reservations. Build one evolving Library object. Done means rejected operations preserve state, reports are deterministic, and active loans reconcile with stock changes.
A neighborhood library needs a small lending service for its internal desk. Its staff receive duplicate stock deliveries, lend copies to named patrons, and record returns. You will turn those actions into a stateful object with one method per operation and a deterministic report that another program can consume.
Each step extends your previous code. A rejected operation must leave stock and ownership unchanged, which becomes more important when you add a per-patron limit and a reservation queue. Keep the order of those checks visible. The final deliverable reports the event transcript, sorted remaining inventory, and the number of active loans. The supplied command strings are a local test interface; there is no database or network connection.