Do It Yourself: Collections
summary
Extends Map to deliver two concrete collections: bag (MultiSet) counts occurrences per element and multimap (MultiValuedMap) maps keys to collections of values, implemented from scratch using only JDK data structures (HashMap + ArrayList) and driven by TDD-driven development with live unit tests. Adds concrete APIs—add, removeOne, count, putAll, asMap view—and demonstrates handling of duplicates, empty inputs, defensive copies and mutation-via-views; shows the code compiles and tests pass and discusses the knobs needed to make the new collections safe and usable.
AI-written summary · about
chapters (5)
- 0:00Introduction
- 10:13Problem statement explained
- 27:40Creating collections
- 40:13Demo and examples
- 53:20Q&A and closing








