Recently Used List
Develop a recently-used-list class to hold strings uniquely in Last-In-First-Out order.
- A recently-used-list is initially empty.
- The most recently added item is first, the least recently added item is last.
- Items can be looked up by index, which counts from zero.
- Items in the list are unique, so duplicate insertions are moved rather than added.
- Null insertions (empty strings) are not allowed.
- A bounded capacity can be specified at construction, so there is an upper limit to the number of items contained, with the least recently added items dropped on overflow.
This kata is described on cyber-dojo.org
Referenced in these Learning Hours:
- Characteristics of Unit tests
- User Documentation and code snippets
- Test Fixtures - Readability vs Duplication